Your cart is currently empty!
How to create a new user with admin privileges on Linux
Need to add a new admin user on your Linux server or local machine? Whether you’re managing a VPS or setting up a new workstation, giving someone administrative access (aka sudo privileges) is a common task. Here’s how to do it quickly and safely, step by step.
Step 1: Log in as Root or a Sudo User
You’ll need root access to create a new user with admin rights. If you’re not already the root user, switch to one using:
sudo -iOr if you’re already root, you’re good to go.
Step 2: Create the New User
Run the following command, replacing newusername with your desired username:
adduser newusernameYou’ll be prompted to set a password and fill in optional user info. Only the password is required—feel free to leave the rest blank.
Step 3: Add the User to the sudo Group
On most modern Linux distributions (like Ubuntu and Debian), adding a user to the sudo group grants them admin privileges:
usermod -aG sudo newusernameIf you’re using CentOS, RHEL, or Fedora, you may need to add the user to the wheel group instead:
usermod -aG wheel newusernameStep 4: Verify the Privileges
To test that everything’s working, switch to the new user:
su - newusernameThen try a command with sudo, such as:
sudo whoamiIf it returns root, you’re done. Admin access is working.
Optional: Customize Sudo Access (Advanced)
If you want to fine-tune what this user can and can’t do with sudo, you can edit the sudoers file:
visudoThen add a line like this (advanced use only):
newusername ALL=(ALL) NOPASSWD: /usr/bin/systemctlThis would let them run systemctl without a password, but nothing else.
Summary
To give a new Linux user admin powers:
- Create the user with
adduser. - Add them to the
sudoorwheelgroup. - Test access with
sudo whoami.
That’s it. Simple, fast, and secure.
Got questions or want more Linux tips? Drop them in the comments below.

Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!
