0

Suddenly, gpg won't ask for password when trying to decrypt file and instead says "cancelled by user". I have already tried..

GPG_TTY=$(tty)
export GPG_TTY

with no effect. I get the following..

gpg: AES256.CFB encrypted data
gpg: cancelled by user
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key

I back up these files on multiple servers but I'm worried one day I will be bricked out of all of them. Sometimes they work over ssh and other times they don't.

/dev/pts/0
7
  • in light of the comment - Sometimes they work over ssh and other times they don't - it's not clear if the issue is occurring with a 'local' decrypt or a remote/ssh decrypt; the fact some ssh sessions work and others don't seems to imply different settings/configs on the remote hosts(?); cancelled by user sounds like an issue with the (popup) window that prompts for a passphrase
    – markp-fuso
    Commented Jun 18 at 13:52
  • short of listing several possible fixes ... have you tried a web search on gpg "cancelled by user" "decryption failed" "no secret key" GPG_TTY ssh? hits cover a few issues like setting pinentry-program in gpg-agent.conf, chmod o+rw $(tty), etc
    – markp-fuso
    Commented Jun 18 at 13:54
  • Weird question: run ls -l /dev/tty when it's broken. If it's a symlink I have a similar issue.
    – davolfman
    Commented Jun 18 at 16:57
  • @markp-fuso It always works locally. It is over ssh where it is inconsistent even with the same connection.
    – slowcoder
    Commented Jun 18 at 19:06
  • I did search and that is where I found the export GPG_TTY method although it didn't work. I don't quite understand gpg enough to parse this problem. Like where are the keys? Why does the password box not pop up on some ssh connections?
    – slowcoder
    Commented Jun 18 at 19:08

1 Answer 1

1

Rebooting the server solved the problem. I don't know why. This is a crap answer but it solved my problem and my help someone else.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .