To allow normal user to run command as Root
We need to use sudo command in order to run command as normal user. Sudo command is more secure than su command. It allows a permitted user to run command as root users as specified in /etc/sudoers file.
The /etc/sudoers is the configuration files which defines or list who can do what as normal users.
Syntax of Sudo files:
/etc/sudoers
USER HOSTNAME=COMMAND
where USER= any normal user
HOSTNAME= Where the command can be run
Example :
Suppose I want to give an sudo access to a user ‘MIKE’ to perform halt on the system.
# visudo
Mike localhost=/sbin/halt
Save and quit
So now user mike can perform halt operation if he wants.
# su mike
$ sudo /sbin/halt
Will ask for the password.

Leave a Reply