Setting up sudo for specific commands

blackbone

Member
Joined
Mar 16, 2008
Messages
11
Reaction score
0
I'd really appreciate some help here. I need to set up the sudoers file so that one user can execute commands/scripts set to be executed only by a particular user. For example, let's say there's a couple of commands/scripts that only John or root can execute. I need to give another use, say Peter, the powers to execute those same commands/scripts, without necessarily giving him root proviledges...is that clear? and if so, is it achievable? (I know almost nothing is impossible in computers :)) And the final question...how do I achieve it?
 
You could just set the permissions on the script to be run by a specific group. Create that group and make sure the people who need to access and run the script is in that group.

Far safer than giving someone sudo access.
 
username machine=command

ie.
mary localhost=/sbin/mount

or to have them run the command without a password
john ALL=/sbin/mount NOPASSWD: ALL

Read the comments in /etc/sudoers
 
Top
Sign up to the MyBroadband newsletter
X