I've got a program that runs once and removes itself from
sudoers when finished. And I've got some scripts that call that function from an
ssh session. What I'd like is for these commands not to hang up at the password prompt when the command I want to run is not in
Is there a way to override the
SUDO_ASKPASS function to just bomb out so I can skip running things that would otherwise present me with password prompts?
My best attempt was something like:
SUDO_ASKPASS=/bin/false sudo -A /opt/sbin/mycommand
but it left me with
sudo: pam_authenticate: Conversation error
I basically want
sudo to never prompt me for a password regardless of whether the command I'm running is in sudoers.
My lazybones fix is to remove the
-t from my
ssh command and hope that I never need to actually use the terminal.
Another fix, I guess, would be just to toast my script that is in
sudoers and make it print an ASCII thumbs-up or something useful.
Is there a straightforward way around this?