To use a system a user must be able to access/read many parts of the system. But he will not be able to write outside of his own home directory (i.e. /home/user1
).
This of course should not apply to the home directories of other users. (Supposedly for convenience) Ubuntu comes with a default setting where everybody has read access to all home directories of other users.
ls -l /home
will show something like
drwxr-xr-x 54 user user 4096 Jan 25 17:17 user
drwxr-xr-x 52 user1 user1 4096 Dez 21 17:47 user1
drwxr-xr-x 198 another another 12288 Jan 25 17:19 another
Look at the permissions at the beginning of each line:
drwxr-xr-x
^^^
The marked part means: "Everybody else can read the directory and cd
into it"
You can prevent this by issuing
sudo chmod 0700 /home/*
check with ls -l /home
and you will see something like
drwx------ 54 user user 4096 Jan 25 17:17 user
drwx------ 52 user1 user1 4096 Dez 21 17:47 user1
drwx------ 198 another another 12288 Jan 25 17:19 another
Now no user will be able to see the contents of another user`s home directory (of course neither with Midnight Commander).
If you want to prevent this issue for newly added users there are several ways, depending on how you create the new user.
When you add new users with the GUI (System Settings/Users)
This takes the permissions on the home directory from the existing permissions on etc/skel
. So
sudo chmod -v 0700 /etc/skel
will give the desired result.
When you add new users with adduser
Edit /etc/adduser.conf
. Find the line
DIR_MODE=0755
and change it to
DIR_MODE=0750
/home/user1
folder. – X9DESIGN Jan 24 '17 at 20:24