sudo -A 忽略 SUDO_ASKPASS 变量
我一直在使用sudo -A
并且SUDO_ASKPASS
多年来没有遇到任何问题。
我有一个新安装的 Xubuntu Focal Fossa 工作站,但我无法sudo -A
上班
我有:
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:~$
我到底忘记了什么?