Tuesday, June 26, 2018

How to add user and grant Root Privileges in centos 7

Description: To assign root privileges to another user on centos 7

Procedure: 

  • First add user using below command 
# adduser testuser1

  • Set password to user 
# passwd testuser1

  • Grant privileges to user using below command 
# visudo

## find the following content
root ALL=(ALL) ALL
## Add following content
testuser1 ALL=(ALL) ALL


  • Then save and exit file using :wq command
  • To test privileges login with testuser1 and use below command to take previleges
$ sudo su
password prompt for testuser1 now testuser1 can run all commands as a root. 

No comments:

Post a Comment