RHEL 8 / Centos 8 Add new sudo user

Last updated on August 21st, 2020 at 11:23 am.

This is a quick tutorial that will show you how to add a user with sudo privileges.

Instead of using root user, always disable root login and use the sudo user for login in and operating your server.

Step 1 – Add a new user called Joey

Add a new user named Joey . Replace Joey with your intended username.

adduser Joey

Set a password for Joey. You’ll be prompted to input and confirm a password. Ensure the password is strong by using a mixture of small , capital and special alphanumeric characters.

passwd Joey

Add new user to wheel group

Add the new user , Joey to the wheel group so that it can assume root privileges using the sudo command.

usermod -aG wheel Joey

Test the new user by login in as follows:

Switch to the new user you’ve created.

su - Joey

Add your password to login. Then run some sudo command eg:

sudo dnf update

Enter your password again, to use sudo commands. If it runs with no warnings or errors then you have anew sudo user.

That is how to create a new Sudo user in Centos 8 or RHEL 8

Comment Here

Need WordPress help? Linux Server help? Talk to us.

  • We are your own WordPress customer service.
  • We set up Linux servers and install or migrate WordPress. Learn more here.
  • We support WooCommerce too.
  • Check out our WordPress customer support plans here or contact us below .

If you have any questions regarding WordPress support, Linux server support or any of our services, feel free to reach out or read more on our services page.

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!