Sudo askpass not working on macOS Sierra I use askpass to run commands as root. In file pass.txt I have this written:

#!/bin/bash 
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/&lt;username&gt;/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/&lt;username&gt;/pass.txt. I can't test this though.