Adding new users in Linux
When adding new users, we first need to give our users a name.
This is Bob. Bob is new to Linux and all of it’s glorious powers. We will give Bob life.
sudo useradd bob
This will add Bob into the pool of users that endlessly creep around their home directory… Wait. We forgot something.
sudo userdel bob
Sorry Bob, but you were home-less.
sudo useradd bob -m
This will give bob a home directory.
By default, Bobs home directory will be populated from the /etc/skel folder. You can add anything you want a new user to have, though it is better to edit /etc/profile as all changes will take effect for everyone after a system reboot.
If you want Bob to be an all-mighty sysadmin like yourself, you can of course use this command with the -r switch.
sudo useradd bob -mr
Or if Bob already exists:
sudo usermod -aG sudo bob
This will add him to the sudo group.
You should run this command if you decided to kill Bob. He will live on in the rest of my tutorials.
sudo rm -r /home/bob
Now you can start adding new users, like Bob here, to Linux systems.
Specific questions? Specific commands and tutorials? Email me at nicholas.frillman@gmail.com and I will answer them or feature them in another post.