I use askpass to run commands as root. In file pass.txt I have this written:

echo mypassword

And then I run it like this:

export SUDO_ASKPASS=pass.txt ; SUDO_ASKPASS=pass.txt ; sudo -Ak true

Before Sierra this worked just fine, but now I get an error:

sudo: unknown defaults entry `askpass'

But askpass actually works. BTW, I get this error every time I run sudo. That's the end of shudders file after exports:

Defaults:ALL askpass=/Users/username/pass.txt

How to fix this?


Remove the line Defaults:ALL askpass=/Users/<username>/pass.txt from the file /etc/sudoers. I don't know the purpose of the line – at least it seems to be malformed compared to other Defaults entries and reading man sudoers.

A proper line may be: Path askpass = /Users/<username>/pass.txt. I can't test this though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .