I added user with adduser user and then entered password with passwd password. When I su - user I got "No directory, logging in with HOME=/"
What's going on, how do I fix it?
I added user with adduser user and then entered password with passwd password. When I su - user I got "No directory, logging in with HOME=/"
What's going on, how do I fix it?
Take a look at /etc/passwd and see what the users home dir is set to, it should be the 6th : seperated column
Use usermod to change his home dir:
Likely the home directory was not created along with the user. The easiest method would be using usermod:
Where
So this does not happen in the future you should always use the ‘create home’ option with useradd: -m or --create-home. This will build out the new home directory using /etc/skel as the template.
It is saying that the directory does not exist, check to make sure that /home/username exists. If it does not then run the following commands
This should create the directory for the user and stop the error you are seeing from showing up.
Maybe your version of adduser doesn't create the new home directory by default?
In future use the
-m
switch touseradd
: