I'm working with a fresh install of Ubuntu 12.04 and I've just added a new user:
useradd -m testuser
I thought that the
-m flag to create a home directory for users was pretty standard, but now that I've taken a closer look I'm a little confused:
By default the new directory that was just created shows up as:
drwxr-xr-x 4 testuser testuser 4.0K May 20 20:24 testuser
o+r permissions that means every other user on the system can not only
cd to that user's home directory, but also see what is stored there.
When reading over some documentation for suPHP it recommends setting the permissions as
drwx--x--x which is how it would make the most sense to me.
I noticed that I can change the permissions on the files inside
/etc/skel and they are set correctly when creating new users with
useradd -m but changing the permissions on the
/etc/skel directory itself does not seem to have any effect on the new directories that are created for users in
So - what type of permissions should a user's home directory and files have - and why?
If I wanted permissions to be different for
useradd -m- like the
drwx--x--xas I saw mentioned, how is one to do that? Must you create the user and then run