Creating Ubuntu User Accounts | Generated by AI
Creating a New User in Ubuntu Linux
Ubuntu provides both command-line and graphical methods to create a user. The command-line approach is straightforward and works on all editions (including servers), while the GUI is available on desktop versions.
Command-Line Method (Recommended)
- Open a terminal (Ctrl+Alt+T).
- Run the following command, replacing
usernamewith your desired username:sudo adduser username- This will prompt you to set a strong password for the new user.
- You’ll also be asked for optional details like full name, room number, work phone, etc. Press Enter to skip these or provide info as needed.
- (Optional) To grant the new user administrative (sudo) privileges:
sudo usermod -aG sudo username- This adds the user to the
sudogroup, allowing them to run commands with elevated permissions.
- This adds the user to the
The new user will have a home directory at /home/username and can log in immediately.
Graphical Method (Desktop Only)
- Open the Settings app (search for it in the Activities overview).
- Navigate to Users in the sidebar.
- Click Unlock in the top-right corner and enter your admin password.
- Click Add User.
- Fill in the account type (Standard or Administrator), full name, username, and password.
- Click Add.
Verification
- Switch to the new user with
su - usernameor log out and log in. - Check users with
cat /etc/passwd | grep username.
This process works on Ubuntu 24.04 LTS and later versions.
User management - Ubuntu Server documentation
Add a new user account - Ubuntu Documentation