Home Linux CentOS How to Give Root Privileges to the User on CentOS 7

How to Give Root Privileges to the User on CentOS 7

Key Points:
How to give root privileges to the users?
How to add a user to a Sudoer group?
How to add a user to a wheel group?

In the earlier tutorial, I have explained to you how to create a user on CentOS 7. Now I will let you know, how to give root privileges to the user on CentOS 7.

  • In CentOS 7, add a user in a wheel group to give the superuser access or root privileges. For example, you want to give superuser permission to a user “arun“.
[root@localhost ~]# groups arun
[root@localhost ~]# usermod -aG wheel arun
[root@localhost ~]# groups arun
add user to a wheel group on CentOS 7
add user to a wheel group on CentOS 7
  • Superuser permissions given to the user. Now run command with prefix sudo, so you will not get the error of Permission denied.
Sudo user command output
Sudo user command output

Key File:

1. /etc/sudoers : Sudo user permission is controlled by this file. By default line starts with %wheel% is uncommented and should exactly look like this:

[arun@localhost ~]$ sudo vi /etc/sudoers



Perfect!!! You have learned how to give superuser/root privileges to the user on CentOS 7.


2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here