尝试了各种网上的方法,还是没法让gpg在ssh环境下fallback到curses或者用pinentry-tty.
下面的方法能够让ssh到ubuntu machine的terminal prompt密码,但是在terminal emacs内还是没法prompt密码。
# Fallback to pinentry-curses if in ssh terminal
if [[ -n "$SSH_CONNECTION" ]]; then
export GPG_TTY="$(tty)"
export PINENTRY_USER_DATA="USER_CURSES=1"
fi
基本mac下配置了pinentry-mac, ubuntu下用的pinentry-gnome,我测试了ssh到mac或者ubuntu的机器,因为配置了gui端的pinentry,ssh下调用gpg sign它还是会启动gui端的pinentry,所以就会发现我远程的机器界面弹出了密码框:(
求助怎么在ssh环境下使用gpg呢?
环境: Ubuntu 18, gpg 2.2.4 macos big sur, gpg (GnuPG) 2.2.25