When we use useradd
, what is the difference between -d
and -m
? Because the definitions of both sound similar, which is responsible for creating a home directory.
I tried:
sudo useradd -s "/bin/false" -g [existingGroupName] [userNameToAdd]
After the command I looked it up in /etc/group
, but the user is not in the [existingGroupName]
. Why is that so?
I am adding a user named 'test' in my Ubuntu 18.04 server. When I add the user using adduser
, like this:
sudo adduser --system --group test --shell /bin/bash
all goes well, I can login fine, but .bashrc, .bash_logout and .bash_profile are not made by default in the home dir. Whereas when I added the user using useradd
like this:
sudo useradd -m test -s /bin/bash
the user is added in the same way as adduser
and I have a preconfigured .bash_profile, .bashrc and .bash_logout in the home dir.
Can someone explain why is there a difference ? Am I missing any flag in adduser
usage ?
What is the difference between
adduser user_name group_name
and
usermod -G -a user_name group_name
At first glance they seems to do the same thing : add a user to a group.
Trying to switch accounts to my newly created account I get a black screen and then it takes me back to the main login screen after entering the correct password.
Upon logging into my previously existing account I get:
"System Program Problem Detected"
Details:
Executable path /usr/bin/Xorg
Package: xserver-xorg-core 2:1.11.4-0ubuntu10.1
Details: Crash
... (tons more, but no way to copy paste or save)
When I try to su
su -l penner
I get:
No directory, logging in with HOME=/
I manually created the home directory and this error goes away but still no luck with the login. Seems something has gone wrong with the user creation? How can I correct this?