permission of command SUDO

If you want to users can use command sudo with fews command, ex: user can restart mysql, or restart apache, you can grant permission for user this command by below way:
Edit permission of command sudo
use command
visudo

## granted user HOST=(sudoer user) password_protected_command NOPASSWD: password_unprotected_commands

ex:
thanhnp localhost=(root) /sbin/service httpd NOPASSWD: /sbin/service mysql

grant: user will grant permission use command sudo , ex thanhnp
host : host will implement this command
sudoer user: user can use sudo command
password_protected_command: commands must enter pass when run
NOPASSWD: commands when that run, user don’t need enter pass

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s