As in title - I'd like to allow non-root users to execute specific command, but not binary. Eg:

# killall sshd

but not allow to kill any process.


You can use sudo. This command is very flexible and will permit you to specify the exact commands and users to be able to use escalated privileges


You can add the user to /etc/sudoers (edited from /etc/passwd, that was a mistake)

// Enable user to run a command.

userxyz ALL=(ALL) NOPASSWD: /var/lib/somecommand

// Enable user to run command, but restrict it to specific arguments.

zuerxyz ALL=(ALL) NOPASSWD: /var/lib/command ARG1 ARG2 ARG3

I'm sure there's more you can do, but this should get you going.

  • You mean /etc/sudoers, right? – kubahaha May 7 '15 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.