

Ubuntu creates a new user for server setup | Linux user add sudo
When you first set up a Linux or Ubuntu server, one of the most important steps is creating a new user. Almost every cloud provider gives root access by default, but using the root account every day isn’t a smart idea. One wrong command can break the whole system. That’s why it’s better to use a normal user and give them elevated access only when required ubuntu create new user.
In this guide, we’ll walk through how to ubuntu create new user, how to provide sudo access, how to manage groups, and other useful tips. We’ll also look at the difference between adduser and useradd, plus a couple of comparison tables to make things easier.
By the end, you’ll be able to linux create new user for your server, grant permissions properly, and keep your setup clean and secure.
Why creating a new user matters
Every server needs some structure. If multiple people work on the same machine, having only the root account is risky. You can’t tell who made what changes, and there’s no limit on commands.
Creating a new user helps with:
- Security
- Control
- Auditing
- Easy management
- Preventing accidental mistakes
Even if you’re the only person using the server, it’s still safer to work with a normal user and only use sudo when needed.
ubuntu create new user: getting started
Ubuntu gives you two simple ways to add new users:
- adduser
- useradd
Both are useful, but adduser is more friendly for beginners.
Method 1: Create a user with adduser (beginner-friendly)
Most admins prefer adduser because it guides you step by step.
sudo adduser username
You’ll be prompted to set a password and add optional details.
That’s it. Your new user is now active.
But it cannot run admin commands yet. To fix that, we’ll add it to the sudo group soon.
Method 2: Create a user with useradd (more manual)
For automation or advanced work, you might choose user add.
sudo useradd -m -s /bin/bash username
sudo passwd username
This creates a user and sets a password.
It works well for scripts and advanced setups.
Comparison: adduser vs useradd
| Feature | adduser | useradd |
| Easy to use | Yes | No |
| Interactive prompts | Yes | No |
| Creates a home directory | Yes | With flags |
| Best fit | Everyday use | Automation |
If you’re new to Ubuntu, adduser is the safer choice.
If you’re writing scripts, go with useradd.
Linux user add sudo
A user created using the Ubuntu create new user process won’t have admin rights. That’s good for safety, but at some point, you’ll need to run commands that require elevated privileges.
To give sudo access:
sudo usermod -aG sudo username
This adds them to the sudo group.
Then they can run commands like:
sudo apt update
Why not use root all the time?
Root has full access. One wrong command and you could wipe your server’s filesystem or break important services.
Using a normal user keeps you safe. You only elevate permissions when needed.
How to make a user on Ubuntu
Sometimes you may want to create a user called ubuntu, especially when you’re moving from a default cloud image that originally uses that name.
To create this user:
sudo adduser ubuntu
Then give sudo rights:
sudo usermod -aG sudo ubuntu
Now you have a standard admin user without logging in as root.
Add a user to the group Ubuntu
Groups help you manage access. After you make user ubuntu or any other user, you may want to add them to different groups to give them capabilities without giving full sudo.
To add a user:
sudo usermod -aG groupname username
For sudo group:
sudo usermod -aG sudo usernameTo check what groups a user belongs to:
groups username
Useful groups on Ubuntu
| Group | Purpose |
| sudo | Admin access |
| docker | Run Docker |
| www-data | Web server access |
| adm | Access system logs |
| developers | Custom group |
Groups allow you to give only the permissions a user needs.
That’s helpful if you’re managing teams or production servers.
Log in using the new user
After creating your user, switch from root:
su - username
Or if you’re connecting remotely:
ssh username@server-ip
If SSH keys are needed, we’ll cover that next.
Add SSH keys for secure access
Passwords work, but SSH keys are safer.
To set up:
- Create user (or choose existing user)
- Make an SSH folder
- Add public key
sudo mkdir /home/username/.ssh
sudo nano /home/username/.ssh/authorized_keys
Paste the public key, then set permissions:
sudo chown -R username: username /home/username/.ssh
sudo chmod 700 /home/username/.ssh
sudo chmod 600 /home/username/.ssh/authorized_keys
Now your new user can access the server using SSH keys.
Testing sudo access
To make sure everything works:
sudo apt update
If it asks for the user’s password and runs normally, you’re good.
If not, check the groups:
groups username
They must be in the sudo group.
Disable or delete users
If someone leaves the team or you no longer need an account, remove it.
Delete user:
sudo deluser username
Delete user with home directory:
sudo deluser –remove-home username
If you don’t want to delete them, only lock access:
sudo usermod -L username
This keeps their files intact.
Linux creates a new user with a home directory
By default, adduser creates a home folder.
But if you’re using useradd, you need to specify:
sudo useradd -m username
This sets up a folder at /home/username.
Linux user add sudo vs root
A quick comparison:
| User | Access level | Recommendation |
| root | Full | Avoid daily use |
| sudo user | Limited + required elevation | Best practice |
A sudo user still provides control, but with a layer of protection.
Best practices
These simple habits make your work smoother and safer:
- Avoid using root unless needed
- Use sudo only for important tasks
- Create separate users for different teams
- Add users to the proper groups
- Remove users quickly when access is no longer required
- Use SSH keys instead of passwords
Small details like these build long-term server health.
Troubleshooting
User not in sudo group
Fix:
sudo usermod -aG sudo username
Permission denied
Fix:
sudo chown user: user filename
SSH key login not working
Check key folder ownership and permissions.
Most issues come from typos or permission settings.
Ubuntu creates a new user with useradd and a password
If you want to create a user and set a password right away:
sudo useradd -m -s /bin/bash username
sudo passwd username
This creates a shell, home directory, and password.
Create a user for the server application
If you’re installing web apps, running databases, or managing code, create dedicated service users.
Example:
For Nginx or Apache deployments, use www-data.
This keeps everything cleaner and safer.
Quick recap
You’ve learned how to:
- Run Ubuntu create a new user
- Use adduser and useradd
- Assign sudo to Linux user add sudo
- Make user ubuntu
- Add a user to the group ubuntu
- Use SSH keys
- Remove or disable users
- Follow best practices
User management might seem small, but it’s one of the most important things when running a server.
Conclusion
Creating a new user is one of the first things you should do when setting up your Ubuntu or Linux server. It keeps the environment safe, organized, and easier to maintain. You now know how to run the Ubuntu create new user process, add sudo privileges with Linux user add sudo, and add users to groups like add user to group ubuntu.
Take a few minutes to set things up properly now, and your server will stay secure in the long run.
If you’re planning to explore more server tutorials or want hosting that comes ready for development, now is a good time to take the next step.
Start creating users and secure your Linux server today.


Frequently Asked Questions
To ubuntu create new user, use adduser username, then add sudo rights with usermod -aG sudo username. After that, the user can run admin commands with sudo. This setup keeps the server safer by avoiding full-time root usage and still allows controlled access when needed.
adduser is easier and interactive, ideal for most users. It creates a home directory and asks for details. useradd is faster but more manual, often used in automation. Both can create accounts, but adduser is better for beginners, while useradd suits scripts or bulk user setup.
Using root for daily tasks is risky. A simple mistake can break the system. When you make user ubuntu and give it controlled sudo access, you get safer day-to-day use. If something goes wrong, it’s easier to track and fix. It’s standard practice for secure Linux management.
To add user to group ubuntu or another group, run:sudo usermod -aG groupname username.
You can verify membership with groups username. Groups help control permissions without giving full sudo access. This is helpful for apps like Docker, web servers, or development tasks.
