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?
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/shAnd 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