14

I'm using Ubuntu with several users and I want to make folders viewable just for a specific user. Any idea how to do it?

14

Edit: On second thought, I realized that I may have misunderstood the question. If you want the directory to only be visible to a specific user (i.e. for every other user, that list doesn't even show up in the directory listing), you can't do that without prohibiting other users from listing the contents of the parent directory. So if the directory is /foo/bar then you can remove the r permission on /foo (for everyone but the owner) preventing other users from listing the contents of /foo, but you can't hide /foo/bar specifically (though you can certainly hide its contents).

Old answer:

Make that specific user the owner of the directory and then remove all permissions on that directory for everyone but the owner. In the shell, you'd use chmod to do this:

chmod 700 the_directory

If you're using a filemanager, just remove all the checkmarks in the permissions-tab except the ones in the "User"-column (the exact details depend on the filemanager of course).

  • @MelissaLoos You're right, thanks. I've edited my answer. – sepp2k Dec 15 '19 at 15:22
1

If you prefer to do this from the GUI, this is explained in the help for the GNOME file browser (known as Nautilus):

http://library.gnome.org/users/user-guide/2.29/nautilus-permissions.html.en#nautilus-permissions-folder

Basically, you just select the folder, and then from the menu choose File->Properties->Permissions.

Otherwise, sepp2k's answer is absolutely correct, and txwikinger's link is great if you're interested in an in-depth explanation of unix file permissions.

0

This tutorial explains in all details how to set file permissions in Linux (and therefore also in Ubuntu) such that you can control the access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.