"Could not chdir to home directory /home/me: No such file or directory"
94,936
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
Related videos on Youtube
Author by
ddd
Updated on September 18, 2022Comments
-
ddd over 1 year
I am using 12.04 on my server.
I created a new user using
adduser me
andpasswd 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?-
MattDMo over 10 yearshow did you create the new user?
-
ddd over 10 yearsthat answer is not at all related to this question and does not help me.
-
Braiam over 10 yearsWhat command you used to create the user? Also add to your question the output of
cat /etc/passwd
. -
ddd over 10 yearsadduser me, passwd me
-
Christopher B. Adkins over 10 yearsPlease add the output of
getent passwd $USER
to your question
-
-
ddd over 10 yearshowever at the last step I get
cp: cannot stat
/etc/skel/*': No such file or directory` what does this do? -
ddd over 10 yearswhen I do
useradd -D me
it just outputs list of arguments. I have ranuserdel me
before -
Braiam over 10 yearsPlease, edit your question and add the output of
apt-cache policy passwd
. -
ddd over 10 yearsfollowing this instruction did not successfully resolve the problem.
-
Braiam over 10 years@ddd but then tell what went wrong... edit your question and add the information...
-
Egwor over 4 years@ddd you missed the '.'. What you needed to do was cp /etc/skel/.* /home/me/ not cp /etc/skel/* /home/me/
-
Shannon almost 4 years@Braiam, I had similar issue and went through your instruction. The last line(cp /etc/skel/.* /home/me/) gives me error: 1. cp: -r not specified; omitting directory '/etc/skel/.' 2. cp: -r not specified; omitting directory '/etc/skel/..' any idea?