1

I just realized that the default permissions of every directory in /home is set to rwxr-xr-x, so that any unprivileged account can read the content of other people's files. Why is it so, and is it safe to change it ?

3
  • IMHO permissions are perfectly fine. Other users dont have write permissions, hence.cannot overwrite files. Use umask as waltinator shows or explicitly chmod files that you dont want others to read Mar 5, 2017 at 1:25
  • How could "everyone on the system can read all my files b default" perfectly fine ? I was under the impression that confidentiality was one of the main reason passwords were used... If you have to discover by yourself that you have to change it, it's a big problem from my POV.
    – Hey
    Mar 5, 2017 at 8:12
  • And for that reason you can modify file permissions. Having multiple uses with accounts on the system requires at least certain level of trust, don't you think ? In particular, if you consider Unix as OS originally intended for professional environment where multiple users had to collaborate, it makes sense that files would be readable. Again, as administrator, it's your responsibility to alter default settings. See Gilles answer on this same topic : unix.stackexchange.com/a/315197/85039 Effectively, your question is duplicate of that same one Mar 5, 2017 at 8:19

1 Answer 1

2

It is because you have not set your umask value to something other than your system's default of 022. Read man umask to understand what the bits are about, and man bash about the umask command.

The umask is used by open(2), mkdir(2), and other system calls that create files to modify the permissions placed on newly  created  files  or  directories.
Specifically, permissions in the umask are turned off from the mode argument to open(2) and mkdir(2).
1
  • I know what umask is, I asked why this is the system's default. It's totally insecure on a multi-user machine.
    – Hey
    Mar 5, 2017 at 8:11

Not the answer you're looking for? Browse other questions tagged .