[SOLVED] nopasswd in /etc/sudoers
I want to run the command nmap from within a shell script driven by cron. Nmap requires root privileges which means my non-root user account normally requires sudo to run it. In this case the command is running inside a script and therefore it is not possible to supply the required password. I've modified the file /etc/sudoers in an attempt to address this issue. Here's what I've done:
$ sudo visudo -f /etc/sudoers
then I modified the contents of the file as follows:
# User privilege specification
root ALL = (ALL) ALL
charlie ALL = (ALL) ALL
charlie ALL = (root) NOPASSWD: /usr/bin/nmap
Then I saved and quit the file. At this point I expected to be able to run the command nmap without being promted for a password, but that did not happen. It seems to have had no effect.
What am I missing?