Friday, July 24, 2015

[CentOS] Grant user permission with command line [edit sudoers file]

The command works on CentOS and Fedora only, and sample OS is CentOS version 7.0: 

Step 1

To grand permission to users, you need to edit your sudoers file, the command "visudo" is to open sudoers file to edit.

visudo


Step 2 

Press the key "i" to enter insert mode.

Step 3 

Scroll down on the line "## Allow root to run any commands anywhere", and add the user's name you want grand them permission:

## Allow root to run any commands anywhere
root                      ALL=(ALL)       ALL
exampleuser        ALL=(ALL)       ALL


Step 4

Press key "esc" and then type the command:

:wq


Reference:

No comments :

Post a Comment