Ubuntu Server is a popular Linux distribution that offers a wide range of features and applications. One of the most popular applications on Ubuntu Server is the web browser, Firefox. To add a user to Ubuntu Server, you first need to create an account and then use the user management tool to add them. To add a user on Ubuntu Server, open the Terminal and type: sudo adduser The sudoadduser command will add the user to Ubuntu Server. You can also use this command to remove the user from Ubuntu Server if they have been added but you do not want them active.


useradd

The useradd command will let you add a new user easily from the command line:

This command adds the user, but without any extra options your user won’t have a password or a home directory.

Note: if you get a message saying that the command is not found, try using the full path, like this:

You can use the -d option to set the home directory for the user. The -m option will force useradd to create the home directory. We’ll try creating a user account with those options, and then use the passwd command to set the password for the account. You can alternatively set a password using -p on the useradd command, but I prefer to set the password using passwd.

This will create the user named testuser and give them their own home directory in /home/testuser. The files in the new home directory are copied from the /etc/skel folder, which contains default home directory files. If you wanted to set default values for your users, you would do so by modifying or adding files in that directory. If we take a look at the new home directory for the user:

sudo passwd testuser

You’ll notice that there are bash scripts in this directory. If you wanted to set default path options for all new users, you would do so by modifying the files in /etc/skel, which would then be used to create these files by the useradd command.

adduser

The adduser command is even easier than the useradd command, because it prompts you for each piece of information. I find it slightly funny that there are two virtually identically named commands that do the same thing, but that’s linux for you. Here’s the syntax:

Example: