CENTOS apache ALL=(root) NOPASSWD: /path/to/shell.sh is not working
Solution 1:
The command you call with sudo
must match what is in the sudoers
file, but in your case they do not match.
You tried to run bash /usr/bin/iptables.sh
, but sudoers
only allows you to run /usr/bin/iptables.sh
.