How to Create a New User on Your Linux VPS
How to Create a New User on Your Linux VPS
In this guide, you will learn how to create a new user account on your Infrawire Linux VPS. This is a great security practice, as it lets you avoid using the root account for everyday tasks.
Before starting, make sure you are already connected to your server via SSH as root or another user with administrator privileges. If you haven't connected yet, check out our SSH connection guide first.
Step-by-Step Instructions
Step 1: Connect to Your VPS
Open your terminal and connect to your server via SSH:
ssh root@SERVER_IPReplace SERVER_IP with your actual server IP address.
Step 2: Create the New User
Once connected, run the following command, replacing newuser with the username you want to create:
adduser newuserOn some distributions (like CentOS or older Debian systems), you may need to use
useradd newuserinstead, followed bypasswd newuserto set the password separately.
Step 3: Set a Password
If you used adduser, you'll be prompted to enter and confirm a password for the new user right away:
New password:
Retype new password:
Choose a strong, unique password.
Step 4: Fill in User Information (Optional)
The system may ask for additional details like Full Name, Room Number, Work Phone, etc.
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
You can simply press Enter to skip these fields, they are optional.
Step 5: Confirm the Information
You'll be asked to confirm that the details are correct:
Is the information correct? [Y/n]Type Y and press Enter.
Step 6: Grant Administrator Privileges (Optional)
If you want your new user to be able to run commands with sudo (administrator privileges), add them to the sudo group:
usermod -aG sudo newuserOn CentOS/RHEL systems, the group is usually called
wheelinstead:
usermod -aG wheel newuserStep 7: Test the New Account
You can now test your new user by opening a new terminal session and logging in:
ssh newuser@SERVER_IPIf you granted sudo privileges, you can verify they work by running:
sudo whoamiThis should return root after you enter the user's password.
🔒 Security Best Practice: We recommend creating a dedicated user with sudo privileges for daily use, and disabling direct root login via SSH afterwards to further secure your server.
Updated on: 12/08/2026
Thank you!
