Add a User on the Sudoers on CentOS 7

Windows Articles

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the...

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to...

Installing Taskwarrior – TODO list from the command line

Hello, friends. You know we really like the terminal. That's why today we will help you installing Taskwarrior on Linux. With this...

Use Windows 10 as a hacking system by installing Kali Linux

Hello! Windows and GNU/Linux is a relationship that was previously similar to water and oil. In fact, the differences were so vast...

How to create a Widget of any Web page in Android

Android widgets are one of the flagship features of Google's mobile operating system. The possibilities of customization of widgets are endless. Imagine...

On CentOS, you get the very vibe of the corporate and server workspace where not all the users are allowed to have access to everywhere in the system. The only user with TRUE power is the “root” user holding the admin privilege to even manipulate data on the hardware-level!

For other users, they have to contact the “root” user to perform the tasks that require elevated privilege. In most of the Linux distros, you have the “sudo” command that allows that certain command to be run as an admin task.

However, on CentOS, even if you know the password of the “root” account, you still can’t perform “sudo” commands. CentOS protects the sudo access to only known users.

Today, we’ll be having a look at adding a user on the “Sudoers” list, essentially enabling the access to the “sudo” command.

Performing this action should only be allowed when it’s necessary. Otherwise, the system admin should do the job personally. If you’re a system admin, make sure that you understand what you’re about to do.

Optional steps

If the user account was created before, then don’t follow the following steps. In this section, we’ll be checking on adding a new user in the system.

At first, enter the “root” mode –

su -

Now, add a user in the system –

adduser <username>

 

Time to add a password for the user –

passwd <username>

Adding a user to the “sudoers”

Run the following command as the “root” –

usermod -aG wheel <username>

This command will add the specific user into the “wheel” group. By default, the users in this group will automatically have the access to the “sudo” command.

Switch to the new user –

su - <username>

Now, run any command using “sudo” –

Voila! Everything is working properly!

More articles

1 COMMENT

  1. Don’t like sudo. I won’t use it on any of my systems. Too easy for someone who doesn’t know what they’re doing to royally screw things up.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the...

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to...

Installing Taskwarrior – TODO list from the command line

Hello, friends. You know we really like the terminal. That's why today we will help you installing Taskwarrior on Linux. With this...

Use Windows 10 as a hacking system by installing Kali Linux

Hello! Windows and GNU/Linux is a relationship that was previously similar to water and oil. In fact, the differences were so vast...

How to create a Widget of any Web page in Android

Android widgets are one of the flagship features of Google's mobile operating system. The possibilities of customization of widgets are endless. Imagine...
x