I am trying to understand system administration on Ubuntu. So, as an example, I create a dummy user using
sudo useradd -d /home/linda linda
and passwd
to create the password. I check that an entry has been made using cat /etc/passwd
linda:x:1004:1004::/home/linda:/bin/sh
However, when I su - linda
, I get
No directory, logging in with HOME=/
and indeed, no home directory has been created. What am I missing?
Thanks.
Best Answer
man useradd
states:Note the
low level utility
To add a user, use
adduser
instead. It's a more high-level utility.Moreover, looking at the
-d
option:The directory will not be created if it is missing.
Generally keep away from
useradd
, useadduser
instead.