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 ?

Hey
  • 224

1 Answers1

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).
waltinator
  • 37,856