Wednesday, June 13, 2012

Allow sudo to run any command as another non-privileged user

Ever need to have the ability to run sudo to trigger a command as another non-root user?

Give this a try sometime:
icinga ALL = (ubuntu) NOPASSWD:ALL

This allows the user icinga to run anything it wants as ubuntu without asking for a password. You trigger this by having icinga trigger the command like:
sudo -u ubuntu -i /home/ubuntu/bin/awesome_script.sh 

No comments:

Post a Comment