How do I limit the users a specific user can run commands in linux?

Posted by user8571 on Server Fault See other posts from Server Fault or by user8571
Published on 2011-01-17T12:25:49Z Indexed on 2011/01/17 12:54 UTC
Read the original article Hit count: 212

I have 2 user accounts, foo and bar

I want to allow user foo to execute commands as root and any other user ie:

sudo su root -c'./run-my-script'

sudo su bar -c'./another-script'

sudo su another -c'./yet-another-script

I also want to allow user bar to execute commands as other user but only a subset and not root ie:

sudo su bar -c'./run-my-script'

but not

sudo su root -c'./run-my-script'

Is this possible ?

© Server Fault or respective owner

Related posts about linux

Related posts about user-management