Bugzilla – Bug 110
Cannot run /usr/local/bin/lsof -i -n -P -u^root,^oracle,^www,^sniff" with sudo
Last modified: 2004-05-12 18:55:31 MDT
My /etc/sudoers file contains the lines Cmnd_Alias LSOFU=/usr/local/bin/lsof -i -n -P -u"^root\,^oracle\,^www\,^sniff" %dci_asl_dev ALL=NOPASSWD: LSOFU sudo -l reports You may run the following commands on this host: (root) NOPASSWD: /usr/local/bin/lsof -i -n -P -u"^root,^oracle,^www,^sniff" but when I try to run sudo /usr/local/bin/lsof -i -n -P -u"^root,^oracle,^www,^sniff" I get Password: Sorry, user mkelly is not allowed to execute "/usr/local/bin/lsof -i -n -P - u^root,^oracle,^www,^sniff" as root on **************. If I change the command to just "/usr/local/bin/lsof -i -n -P" it works OK.
Looks like your shell is eating the double quotes, try escaping them with a backslash.