3

I added several users to my server using useradd -d /home/<username> <username> . The users are able to log in and access their directories, but get Permission denied error messages when attempting to create files or directories.

I thought that associating a home/username directory with username gives them read/write permission, and that I don't have to use chmod to give the user permissions to their own home directory. Presumably I missed a step when creating the user account, please clarify.

1 Answer 1

3

You should use option -m to create the home dir when doing useradd. -d ... is only to override the default name for the home dir, which is the same as the one you actually gave. You need to chown name:name /home/name for each name now to recover.

-m is useful as it also copies some standard files into the home dir.

1
  • OK, thanks. I thought that the -d argument would set permissions to the home directory. In any case, chown fixed the issue, my main concern was how to avoid having to do this in the future. Commented Sep 30, 2015 at 15:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.