How to `sudo` shell scripts with NOPASSWD in authorized_keys?

view story

http://unix.stackexchange.com – I visudoed sudoers to allow a user to run one bash script with a passwordless sudo, which works fine when logged in (also via SSH). However, when I log in via SSH using public key authentication and configure authorized_keys' command="sudo myScript", I am promped for the user password by sudo. Having the script itself use sudo on another program does however work without requiring a password. What's the problem here and how can I solve it? Here's the uncommented parts of sudoers: Cmnd_Alias DMCRYPT = /opt/bin/dm.mount, /opt/bin/dm.umount root ALL=(ALL) ALL crypter ALL=(root) NOPASSWD: DMCRY (HowTos)