nice article

Tapas Mishra

sudo command allows users to do tasks on a Linux system as another user.

Sudo is more  secure then su command.

Log files : /var/log/secure (Red Hat/Fedora / CentOS Linux)

/var/log/auth.log (Ubuntu / Debian Linux).

So we can get the details using above log files that which user has perform which task or command using sudo or as privilage user.

Below is the general syntax for /etc/sudoers file


Use of Sudo :

1) #visudo

2 )Enter this line in open file  tapas localhost=/sbin/reboot

3 ) Save the file

4 ) Now user tapas can reboot the server using below command

# sudo /sbin/reboot

You can see the information of this user in /var/log/auth.log  or /var/log/secure file

Examples :

1) Specify multiple commands for user tapas:

tapas ALL=/sbin/reboot, /etc/init.d/apache2 , /etc/init.d/mysql

2) Allow user tapas to run /sbin/reboot without any password
tapas ALL= NOPASSWD: /sbin/reboot

3) Allow user tapas…

View original post 14 more words


One comment on “

  1. […] Allow a normal user to run commands as root in Unix/linux ( […]

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s