http://qs321.pair.com?node_id=884304


in reply to Automating sudo actions

EDIT: Re-reading the thread, I see that this is not what you're looking for.

If you're admin on that box, then you can avoid password prompt by using NOPASSWD in the sudoers file. Like this:

# User privilege specification root ALL=(ALL) ALL ftpauth ALL=(ftpdata) NOPASSWD: /bin/mkdir
Which will allow the user ftpauth to run mkdir as user ftpdata without asking for password.