Creating and removing users
Creating users in Ubuntu can be done with one of either of two commands: adduser
and useradd
. This can be a little confusing at first, because both of these commands do the same thing (in different ways) and are named very similarly. I'll go over the useradd
command first and then I'll explain how adduser
differs. You may even prefer the latter, but we'll get to that in a moment.
First, here's an example of the useradd
command in action:
sudo useradd -d /home/jdoe -m jdoe
Note
As we go along in this book, there will be commands that require root
privileges in order to execute. The preceding command was an example of this. For commands that require such permissions, I'll prefix the commands with sudo
. When you see these, it just means that root
privileges are required to run the command. For these, you can also log in as root
(if root
is enabled) or switch to root
to execute these commands as well. However, as I mentioned before, using sudo
instead of using the root...