Back

How to create a user account on Ubuntu server

How to create a user account on Ubuntu server

Ubuntu typically comes with a single main user who has root (administrative) privileges. In many cases, you’ll want to create a separate user to ensure secure SSH access. In this guide, you'll learn the basic commands (adduser, userdel, passwd) for managing users, as well as how to add a user to the sudo group so they can perform administrative tasks.


Account Creation

To create a new user account, for e.g., named "redfoxcloud", run the following command:

sudo adduser redfoxcloud

You will be prompted to enter a password (the input will be hidden for security). You can skip the additional info fields (Full Name, Phone, etc.) by pressing Enter for each.


Adding account to sudo group

To grant this new user the ability to run commands as root, add them to the sudo group:

sudo usermod -aG sudo redfoxcloud


Account Deletion

To remove an account, for e.g., "redfoxcloud", run this command:

sudo userdel redfoxcloud

This will delete the user but not their home directory (e.g. /home/redfoxcloud). To remove both the user and their home directory, add the -r flag:

sudo userdel -r redfoxcloud


Changing account Password

To change the password of a specific user (e.g. "redfoxcloud) use the following command:

sudo passwd redfoxcloud


If you simply want to change your own password, omit the username:

passwd


Using adduser, userdel and passwd commands, you can easily create and manage user accounts on an Ubuntu system. If you have any questions or run into issues, feel free to contact our live support or email [email protected].


Similar tutorials

How to run Grafana in Docker containerGrafana is a leading open-source tool for visualizing time series data. It’s widely used to visualize data from various...

Read

How to Install a Graphical User Interface (GUI) on Ubuntu 24.04 Server OSThe Ubuntu Server operating system is normally designed to run without a graphical...

Read
Linux Tutorials