Tuesday, 19 April 2016

Using sudo to allow root access to a specific file

There are sometimes situations where you might need to allow a user root privileges for a specific command - a typical case of this is with script / script users.

We can define the following in your /etc/sudoers file:
nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_xyz
Which will allow the 'nagios' user to execute '/usr/local/nagios/libexec/check_xyz' as root.

0 comments:

Post a comment