Add a new user account with admin access on Linux

Originally published at:

How do I add a user account with admin (sudo) access on Ubuntu or CentOS Linux cloud server? How can I add a new user with admin account level access in Linux?

wheel for Ubuntu/Debian ? You say in it’s sudo. Something’s wrong here.

1 Like

@rautamiekka thanks for the heads up. The faq has been updated.

I followed the instructions but still can’t get sudo [command] to work. I get this output: ‘[user] is not in the sudoers file. (…)’

I can verify my user is in the sudo group when I run ‘id [user]’ or ‘groups [user]’

Does this mean I have to manually edit the sudoers file?

@alexnix, can you state your Linux distro name? On same distro you may have to edit the sudoers files to grant group access. Typically line on a Debian look like as follows:


I’m using Debian 10 and hating it so far. Lol

that line is already present in /etc/sudoers

Any idea as to why ‘sudo’ is still not working?

Are you sure the line is not commented out? It should be:


Not as follows:

#%sudo	ALL=(ALL:ALL) ALL

What about the id command? What it says?

id username
cat /etc/group | grep sudo 

Do you see sudo group attached to the username? Also check /etc/sudoers.d/ directory too (do you see any additional files? If so, paste those config here). Some cloud service provider modifies sudo behaviour for management purposes. Are you using Debian 10 with cloud service provider? If so let us know the name.

sudo usermod -aG sudo youruser

for Ubuntu where youruser is the user your need the acccess. CentOS I believe you add them to the wheel usergroup.