I am trying to encrypt and sign a local file using a distant GPG installation via SSH:
pv file | ssh -tt [ssh server] gpg -se -r [receipt key] > file.gpg
Using the double t option removes the
gpg "cannot open '/dev/tty': No such device or address" error. However, instead of being sent to the input of gpg, the content to be encrypted is printed right after the ssh password prompt. Then the input is closed, and so it hangs on gpg asking the password to unlock the private key for signing (or the ssh connection is closed if the file is too large).
What is the proper way to pass data to the input of an interactive command executed through SSH?