In this section we will show you how to add a user account using the useradd
program.
These commands should not be destructive to your system; however, you will need to be the root user.
Note
In most Linux distributions there are two versions of this command, useradd
and adduser
. They do not always do the same thing, so consult your man
page (and/or the file
command) to make sure you are running the proper one. On Fedora, adduser
is a symbolic link to useradd
and so they are equivalent.
Here we will run the useradd
command to add a user and the passwd
command to set the password. There is more discussion of passwd
in the following section:
Firstly, we will be changing
/etc/passwd
, so let’s make a backup copy of it. Run the following command:cp /etc/passwd /tmp/passwd.orig
Now let’s create a user named
test1
:useradd test1
It should have returned silently back to the command line. Now let’s try it:
su - test1
You should...