Difference between revisions of "Allowing users to run specific scripts as root"

From Notes_Wiki
(Created page with "=Allowing users to run specific scripts as root= We can configure sudo with lines, like: <pre> saurabh ALL= NOPASSWD:/home/saurabh/Desktop/test.sh </pre> to allow user saurab...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Allowing users to run specific scripts as root=
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Sudo configuration]] > [[Allowing users to run specific scripts as root]]


We can configure sudo with lines, like:
We can configure sudo with lines, like:
Line 6: Line 6:
</pre>
</pre>
to allow user saurabh to run script '<tt>test.sh</tt>' and nothing else with sudo command. User would be able to run script without supplying user password hence calling of script can be automated using users '<tt>.bash_rc</tt>' or '<tt>.bash_profile</tt>' files.
to allow user saurabh to run script '<tt>test.sh</tt>' and nothing else with sudo command. User would be able to run script without supplying user password hence calling of script can be automated using users '<tt>.bash_rc</tt>' or '<tt>.bash_profile</tt>' files.
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Sudo configuration]] > [[Allowing users to run specific scripts as root]]

Latest revision as of 13:39, 14 July 2022

Home > CentOS > CentOS 6.x > Sudo configuration > Allowing users to run specific scripts as root

We can configure sudo with lines, like:

saurabh ALL= NOPASSWD:/home/saurabh/Desktop/test.sh

to allow user saurabh to run script 'test.sh' and nothing else with sudo command. User would be able to run script without supplying user password hence calling of script can be automated using users '.bash_rc' or '.bash_profile' files.




Home > CentOS > CentOS 6.x > Sudo configuration > Allowing users to run specific scripts as root