Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

Likely the home directory was not created along with the user. The easiest method would be using usermod:

usermod -dm /home/USER USER


  • -d -- Changes the home directory
  • -m -- Creates the home directory if does not exist
  • /home/USER -- where this is the full path to the new home directory.

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.

share|improve this answer

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:

$ usermod -d /home/user user
share|improve this answer
You probably meant to say /home/user, not ~/user. The former will point the user's home directory to /home/user, the second to a directory called user inside the homedirectory of the one who executes the command! – wzzrd Aug 6 '09 at 18:21
Oops, yup you're right. Fixed that :) – Swish Aug 6 '09 at 18:23

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

mkdir /home/username
cp -r --preserve /etc/skel/* /home/username
chown -R username.username /home/username

This should create the directory for the user and stop the error you are seeing from showing up.

share|improve this answer

Maybe your version of adduser doesn't create the new home directory by default?

share|improve this answer

In future use the -m switch to useradd:

-m, --create-home create home directory for the new user

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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