I'm trying to use su (as myuser) to force another user (theuser) to run a shell script (thescript.sh):
su theuser -c /home/theuser/thescript.sh
However I'm running this from another script, and it is asking for theuser's password. I would rather avoid displaying it in the file (using echo <password> | <su command>).
I have searched and seen this asked a lot before, and the solution was to use:
myuser ALL=(ALL) NOPASSWD: ALL
at the end of my sudoers file, however with that it is still asking for the password.