2
thisisme@ubuntu:/home$ ls -al
total 28
drwxr-xr-x  4 root      root       4096  4月 19  2012 .
drwxr-xr-x 24 root      root       4096  4月  9 12:34 ..
drwxr-xr-x 66 thisisme  thisisme   4096  4月 12 10:15 thisisme
drwx------  2 root      root      16384 11月 18 00:07 lost+found

As above, my home folder permission is set as rwxr-xr-x, so it means that everyone on my computer can access into my home folder (/home/thisisme) because all three x flags are set, but in fact (tested by guest login session) only me can access my home folder.

But why not set the permission as drwxrwx--- or something like drwx------?

  • Any user should be able to open and list the contents of /home/thisisme. Are you sure the guest login session can't open /home/thisisme, or is it just unable to view the contents of the files and folders in /home/thisisme? – zhongfu Apr 12 '15 at 3:46
  • Guest neither can access (open) /home/thisisme nor able to view the contents inside. – Kevin Dong Apr 12 '15 at 3:50
  • I found this, which explains why guest sessions cannot view home folders. That is probably enforced by apparmor or something of the like, so if you want to test that, you should probably create a new user account and use that. – zhongfu Apr 12 '15 at 4:00
3

You can set the permissions as drwxrwx--- (770) or drwx------ (700) depending on your preference.

The first allows the owner and users in the folder's group to access the directory and add new files to it, while the second only allows the owner to access the directory.

There should be no difference between the first and second in your case, unless you have other users added to your group (thisisme).

Do note that even if users can add files and read the directory list, they may not be able to read or modify any other files or folders inside that have different permissions that prevent them from reading or writing to it.

Another thing to note is that the reason why you cannot access home folders in guest sessions is because Ubuntu uses apparmor to restrict access to certain folders in guest sessions, including but not limited to /home. If you want to test if other users can access your home folder, you should do it from a new user account.

  • Thanks a bunch for the explanation, but WHY do Linux distros in general set new home folders to drwxr-xr-x? It's such an obvious and pointless security concern. – Teekin Aug 19 '18 at 15:17

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.