Default permission of user home can be controlled in following places.
- The skeleton directory option (
-k, --skel SKEL_DIR) of
SKEL value in
/etc/adduser.conf that define default skeleton directory.
DIR_MODE value in
/etc/adduser.conf that define default permissions.
Home directory of new users are created using
/etc/skel as a template (default behavior).
Default permission of
Using a custom skeleton directory with correct permissions will allow new home directories to have desired permissions.
adduser are defined in
Default value of
DIR_MODE to correct permissions (
DIR_MODE=0750 or similar) will allow new home directories to have desired permissions.
According to Ubuntu documentation, this seems to be the best option.
Already existing user home directories will need to be manually changed.
sudo chmod 0750 /home/username
So its a good idea to change
/etc/adduser.conf right after the installation to avoid new users getting
0755 (drwxr-xr-x) type permissions.
Still the very first user created during installation will have
0755 set to its home directory, which should be manually changed.
/etc/login.defs is a general setting for files/directories/etc created by users (not only in their home directories). and could get changed depending on
The official explanation: User Management - User Profile Security
Check other sections of User Management as well.