Sudoers file RHEL5

rhel5sudo

How do I add the following to the sudoers file in RHEL5?

daemon ALL=(ALL) NOPASSWD: /usr/local/bin/php /var/www/batch.php

Thanks 🙂

Best Answer

Use the visudo command for safe editing of the sudoers file, as root or with sudo:

visudo -f /etc/sudoers

If you don't know vi, you can use whatever editor you want by setting the EDITOR environment variable (assuming $VISUAL is not set), for example as root:

export EDITOR=/bin/nano
visudo -f /etc/sudoers

Although, if you don't know vi basics, maybe you shouldn't be editing your sudoers file :-)

Related Topic