gpg: cannot open /dev/tty: Permission denied

Matthias Urlichs
Thu, 16 Sep 1999 00:33:51 +0200


Randy Harmon:

> In this case, I'm at the command line, and I can't
> see that it should go to /dev/tty for any reason. Passphrase,
> key-confirmation or whatever should go to the controlling terminal (at least
> that's what I would expect).
That's how one talks to the controlling terminal -- open /dev/tty and read/write from there. You can't use stdin/out/err; they might be redirected. Instead of playing games with isatty() and trying to write to stdin (or read from stdout), gpg uses /dev/tty always. That makes sense, IMHO.
> Lastly, why /dev/tty in the case where I try to encrypt to the single public
> key that happens to be on my keyring?
I don't know. You can use truss or strace to find out what exactly gpg writes to /dev/tty. -- Matthias Urlichs | noris network GmbH | | ICQ: 20193661 The quote was selected randomly. Really. | -- To live outside the law, you must be honest. -Bob Dylan