Using GPG on a remote shell
Sometimes you need to use gpg on a remote shell on a machine that is usually operated via a local desktop which in turn means that gpg is configured to use the graphical environment to ask for passphrases. That’s not so hot on a remote shell, though.
PINENTRY_USER_DATA="USE_CURSES=1" GPG_TTY=$(tty) gpg …