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

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
me@server:/$

How can I avoid typing bash every time I login?

5

1 Answer

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
boggus:x:1002:1002::/home/me:/bin/sh

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
8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like