How To Add A New User In Ubuntu 25.04 (Step-by-Step Guide for Beginners)
To create a new user on an Ubuntu 25.04 server, follow these steps. These commands should be run as root or with sudo .
🧑💻 Step-by-step to Create a New User
1. Log in to your server :
ssh your-username@your-server-ip
2. Create a new user :
Replace newusername with the desired username.
sudo adduser newusername
This command will :
- Create the user
- Set the home directory
- Prompt you to create a password
- Ask for optional user info (you can skip by pressing Enter)
3. Add the user to the sudo group (optional) :
If you want the user to have administrative privileges :
sudo usermod -aG sudo newusername
4. Verify the user was created :
id newusername
✅ (Optional) Enable SSH Login for New User
If you want the user to log in via SSH :
1. Switch to the new user temporarily :
sudo su - newusername
2. Create .ssh directory and set permissions :
mkdir ~/.ssh
chmod 700 ~/.ssh
3. Add a public SSH key to authorized_keys :
Paste the key into this file :
nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
4. Exit back to your original user :
exit
Tags :