my sudoers file:
cat /etc/sudoers
...
USERHERE ALL = NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv
...
it looks OK too:
USERHERE@notebook:~/foo$ sudo -l
Matching Defaults entries for USERHERE on this host:
env_reset, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User a may run the following commands on this host:
(root) NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv
(ALL : ALL) ALL
USERHERE@notebook:~/foo$
but when I try it prompts for password, why?
USERHERE@notebook:~$ sudo /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv
[sudo] password for USERHERE:
Using Ubuntu 12.04