I am using 12.04 on my server.

I created a new user using adduser me and passwd me and added it to sudo.

When I log in this is what I see.

Could not chdir to home directory /home/me: No such file or directory    

I type bash and it begins to look "normal"

$ bash

How can I avoid typing bash every time I login?

  • 2
    how did you create the new user? – MattDMo Jan 6 '14 at 21:50
  • 2
    that answer is not at all related to this question and does not help me. – ddd Jan 6 '14 at 21:53
  • What command you used to create the user? Also add to your question the output of cat /etc/passwd. – Braiam Jan 6 '14 at 21:54
  • adduser me, passwd me – ddd Jan 6 '14 at 21:55
  • 2
    Please add the output of getent passwd $USER to your question – Florian Diesch Jan 6 '14 at 21:56

adduser is too basic and doesn't set the defaults properly. It's recommended to use useradd whenever is possible. You can remove the new user and create it again with useradd -D me or repair it yourself:

sudo mkdir /home/me
sudo usermod --shell /bin/bash --home /home/me me
sudo chown -R me:me /home/me
cp /etc/skel/.* /home/me/

If you had used getent passwd me as Florian suggested you should have seen something like this:

sudo getent passwd me

And ls /home wouldn't shown the user directory as your error:

Could not chdir to home directory /home/me: No such file or directory
| improve this answer | |
  • however at the last step I get cp: cannot stat /etc/skel/*': No such file or directory` what does this do? – ddd Jan 6 '14 at 22:06
  • when I do useradd -D me it just outputs list of arguments. I have ran userdel me before – ddd Jan 6 '14 at 22:14
  • Please, edit your question and add the output of apt-cache policy passwd. – Braiam Jan 6 '14 at 22:15
  • @ddd also, you sure is user then add not add then user? Please use copy paste to be sure. – Braiam Jan 6 '14 at 22:16
  • 2
    @ddd but then tell what went wrong... edit your question and add the information... – Braiam Jan 6 '14 at 23:46

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.