How to create a new sudo user in Centos

A sudo user is one that can run root commands by prefacing the command with the word sudo.

To create such a user in a Centos server, follow the steps below:

1. Login to your server as root

ssh root@ip_address

2. Add a new user and choose a password

useradd username

passwd username

3. Add the user to group wheel

usermod -aG wheel username

4. Test the privileges of the new user. Here we do this by trying to list the contents of root directory.

ls /

sudo ls /

Password:

Below is an image of the same procedure.

Was this article helpful?

Leave A Comment?