I'm remotely shutting down a bunch of Macs by using ssh
to execute the shutdown
command on each of them. I've asked the question before (Shutdown "no tty present and no askpass program specified"?) and got it working by adding ADMIN ALL=(ALL) NOPASSWD: /sbin/shutdown -h now
to the sudoers files as recommended.
In the meantime two of the remote Macs got upgraded to Sierra and I again get
sudo: no tty present and no askpass program specified
even though the line in the sudoers file is still there.
What do I need to change to make this work with Sierra?
Best Answer
A proper solution for your remote shutdown script is the following:
Script (please adjust the MAX_UPSEC value, for testing purposes I used a low value):
If you run the shutdown script (assuming the script is located at ~/bin/sh/) with the following command:
the proper sudoers lines on the remote hosts are then