[SWLUG] specifying user in scripts

Justin Mitchell justin at discordia.org.uk
Sun Aug 4 18:44:10 UTC 2002


On  4 Aug, bascule wrote:
> is there a way to run a script as root but have a particular line or command 
> run as a differnet user, 
su someuser -c blahcommand

> indeed is there a way to run a script not as root and do this?
Either via use of the sudo command,
(man sudo, make sure you have the sudo rpm/package)
You set which user and which commands in the sudoers file then
sudo -u someuser  this-command

or possibly via ssh using the authorized_keys mechanism to avoid
passwords.

-J







More information about the Swlug mailing list