User directory doesn't exist

Hii all,

i create the user

useradd -d /home/kk kk
passwd kk

when i tried to login to kk
i get a error user directory doesn't exist

then i tried

useradd kkk
passwd kkk

when i tried to login to kkk
i get the same error user directory doesn't exist.

You can create the directory yourself and chown it to the appropriate user and group...

There are more parameters to useradd. See man useradd .
You were missing the -m parameter .

useradd -c "Name of user" -d /home/kk -m  kk

It's probably easier to delete the account and then re-run useradd with the correct parameters so that you get the profile files copied into the account automatically.

1 Like

Note also that /home might be an automount point in which case you need to create the directory on the shared location instead of using the previously suggested methods. Alternatively, you can of course disable this automount setting if unused.

hi kumar 99

create newone directory ..exp yourrnae
mkdir /kumar
then you can create user
useradd -d /kumar/kk