[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forcing a shell script to run a specific user?



Charles Menzes wrote:
> 
> thanks, sudo was my other option, but i am not certain whether or not it
> will fit my needs. currently, every time i have seen sudo implemented, i
> am prompted for a password.
> i am setting up a model for lunar that will allow a main machine to update
> configuration files on a remote server, and then restart a service using
> ssh. the config files would be updated through rsync using ssh as
> transport, and then i am hoping for example, to be able to restart, say
> dns, by issueing:
> 
>         ssh -l cmenzes ns2.lunarmedia.net "sudo /usr/bin/ndc reload"
> 
> now, if sudo will prompt me for my password, well, i am back to square
> one.
> 

In the sudoers file, put something like this:

_user_  _host_ = NOPASSWD:/usr/bin/ndc,NOPASSWD:/usr/bin/shell_script
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.