Create a Linux User on Ubuntu Server
Learn how to create a non-root user on your Ubuntu server for improved security and better management.
Creating a user on your Ubuntu Server, is a simple command
Root session
adduser deployer
Non root session
sudo adduser deployer
You can replace deployer with any username, but in our guides, we will be using deployer as the default username for the deploy user.
You will be prompted to enter a password for this user. Enter a strong password and confirm it. You will be prompted fro more optional informations about the user, you can skip by pressing Enter without input. At the end, you will be given a summary and asked to confirm. Type Y and press Enter.
The terminal output will look something like this:
Output
info: Adding user `deployer' ...
info: Selecting UID/GID from range 1000 to 59999 ...
info: Adding new group `deployer' (1001) ...
info: Adding new user `deployer' (1001) with group `deployer (1001)' ...
info: Creating home directory `/home/deployer' ...
info: Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for deployer
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y
info: Adding new user `deployer' to supplemental / extra groups `users' ...
info: Adding user `deployer' to group `users' ...
