I'm trying to add users to an existing directory but I keep getting:

useradd: warning: the home directory already exists. Not copying any file from skel directory into it.

I want to add users to the /home/test directory; I know this isn't a good thing to do and there are many reasons why I shouldn't do it, but I need to do it anyway.

I want to add the user alex to the existing directory and ralf, so I tried to change the permission of the folders so users can access it:

chmod -R 777 /home/test

And add the user to the folder:

useradd -m -d /home/test ralf

But when I try to switch to the new user it shows this:

I think it is a permission issue but I am not too sure.

  • What is the reason beyond this? Which result do you want to accomplish? It looks like you're trying to break the system, which is never a wise thing to do (unless for testing). – dr01 May 29 '18 at 7:33

From useradd(8):

-M, --no-create-home

Do no create the user's home directory, even if the system wide setting
from /etc/login.defs (CREATE_HOME) is set to yes.

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.