sudo -A ignoring SUDO_ASKPASS variable
I have been using sudo -A
and SUDO_ASKPASS
for years without trouble.
I have a newly installed Xubuntu Focal Fossa workstation and I cannot get sudo -A
to work
I have:
me@mine:~$ cat .ssh/secrets/.supwd.sh
#!/bin/bash
echo 'SECRET'
me@mine:~$ ll .ssh/secrets/.supwd.sh
-rwx------ 1 me me 27 Apr 25 10:25 .ssh/secrets/.supwd.sh*
me@mine:~$ cat .bash_profile
SUDO_ASKPASS=${HOME}/.ssh/secrets/.supwd.sh
me@mine:~$ source .bash_profile
me@mine:~$ echo ${SUDO_ASKPASS}
/home/me/.ssh/secrets/.supwd.sh
me@mine:~$ ${SUDO_ASKPASS}
SECRET
me@mine:~$ sudo -A reboot now
sudo: no askpass program specified, try setting SUDO_ASKPASS
me@mine:~$
What on earth have I forgotten?
export
it anywhere? what doesdeclare -p SUDO_ASKPASS
report? – steeldriver Apr 25 '21 at 14:46.bash_profile
line fromSUDO_ASKPASS=${HOME}/.ssh/secrets/.supwd.sh
toexport SUDO_ASKPASS=${HOME}/.ssh/secrets/.supwd.sh
and it works! Write it up as the answer and I'll do all the hearts and flowers stuff. Thank you!!! – Martin Bramwell Apr 25 '21 at 14:56