Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

when I create a new user in Ubuntu Server and then try to login with the new user I get an error message.

In one case Ubuntu tells me that the home directory of the user doesn't exist when I login and Ubuntu then shows me a dollar shell. In the other case, when I create a home folder for the user, Ubuntu just shows me a dollar shell when I log in with the user.

I use: useradd NAME. I thought the home directory was automatically created when creating a user.

Can anyone help me?

share|improve this question
Regarding the $-prompt: what did you expect to see? That prompt is normal for the server version (since no desktop). – Rinzwind Jan 19 '13 at 20:46
That question has been answered yesterday: sudo useradd -d /home/user -m user is the correct commnand ;) – Rinzwind Jan 21 '13 at 15:47
problem solved. thx for the help. Forgot something. Stupid. :) – Bodhi Mundi Jan 21 '13 at 16:02

The command to have useradd create a home is

sudo useradd -d /home/user -m user

Where user (2 times) is your account name.

(The files in the new home directory are copied from the /etc/skel folder)

share|improve this answer
I tried the command you gave, but I still have the same problem. Creating the user is ok, but the problem begins after logging in with the created user. I just get the $-prompt. Normally it should be user@ubuntu:~$, what I see is just:$ – Bodhi Mundi Jan 21 '13 at 15:48

You can create a home directory by adding the -d flag.

  -d, --home HOME_DIR
           The new user will be created using HOME_DIR as the value for the
           user's login directory. The default is to append the LOGIN name to
           BASE_DIR and use that as the login directory name. The directory
           HOME_DIR does not have to exist but will not be created if it is

The $ in the terminal indicates that you are not using the bash shell, where you are familiar with I guess. When creating a home dir I guess the problem is over. Otherwise you can switch change to bash with which bash.

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.