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.

2

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.

  • 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. – mshpak Sep 30 '15 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.