Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH, Error: Failed to decrypt #208

Closed
fosspill opened this issue Jul 21, 2017 · 10 comments
Closed

SSH, Error: Failed to decrypt #208

fosspill opened this issue Jul 21, 2017 · 10 comments
Assignees
Labels
gpg GPG related

Comments

@fosspill
Copy link

fosspill commented Jul 21, 2017

Hello!
I seem to be having issues decrypting my passwords over ssh:

oleerik@glare ~ $ gopass dev/github/password

Error: Failed to decrypt

However, after doing this:

oleerik@glare ~ $ gpg --decrypt .password-store/dev/github/password.gpg
gpg: encrypted with 4096-bit RSA key, ID X, created 2017-02-21
      "x <x>"
My github password

It works with gopass again until timeout, I believe:

oleerik@glare ~ $ gopass dev/github/password
My github password

I'm guessing it fails at starting the terminal based pinentry window? Any known reason for this?

Version info: gopass HEAD (n/a ) go1.8.3
Linux

@jamesboswell
Copy link

See my comment on #209 I think your GPG install is unlinked (Homebrew issues)

@fosspill
Copy link
Author

fosspill commented Jul 29, 2017

Hm, this is on Linux and installed through "go get". Could still be related, though?
I can also say that my partner experience the same issue. Again, this is only through SSH.

And:

oleerik@glare ~ $ which gpg2
/usr/bin/gpg2
oleerik@glare ~ $ which gpg
/usr/bin/gpg

@vesparny
Copy link

In my case gpg2 is correctly linked

$ which gpg2 
/usr/local/bin/gpg2

but the terminal based pinentry window does not show up

@arthur-c
Copy link

arthur-c commented Aug 2, 2017

Same issue, no prompt and "failed to decrypt". Everything is fine with the decrypt command showed in debug mode and I've got the prompt.
gopass works well when the private key is unlocked.

No issue on my linux installation (fedora 26), I only have the issue with mac os x.

@glycerine102
Copy link

glycerine102 commented Aug 4, 2017

No issue on my linux installation (fedora 26), I only have the issue with mac os x.

I had the opposite problem. Using Fedora 26 KDE, gopass would only decrypt when the private key was unlocked but it was fine with macOS. I would just receive, "Failed to decrypt" and no pinentry (curses) prompt would display.

Installing and switching to pinentry-qt worked for me. I correctly receive the prompt and the key is unlocked. That leads me to believe (along with the OP) that gopass has issues with pinentry-curses.

@arthur-c
Copy link

arthur-c commented Aug 4, 2017

@nathandorsey good call ! pinentry-qt is my default pinentry on my fedora. I switched to pinentry-mac on the Mac and it's now ok.

cat ~/.gnupg/gpg-agent.conf
pinentry-program /usr/local/bin/pinentry-mac

Forcing pinentry-curse in the gpg conf does not help. (pass is working with pinentry-curse)

@SimonTeixidor
Copy link

I did some debugging using strace -f. It seems like pinentry-curses complains about not having a real TTY when called by gopass. In any case, adding the following line to ~/.bashrc solves it for me:

export GPG_TTY=$(tty)

@fosspill
Copy link
Author

fosspill commented Aug 8, 2017

Can confirm that @simonpersson's workaround works well.

dominikschulz pushed a commit to dominikschulz/gopass that referenced this issue Aug 9, 2017
@dominikschulz dominikschulz added this to the 1.3.0 - Improved UX milestone Aug 9, 2017
@niklas88
Copy link

niklas88 commented Apr 30, 2018

When using the xc backend this problem still persists as export GPG_TTY=$(tty) doesn't seem to affect pinentry but only the gpg binary

@Knappek
Copy link

Knappek commented Jul 26, 2018

An easier solution is to install gpgtools with brew install gpg-suite. Gopass will then ask for the passphrase.

kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpg GPG related
Projects
None yet
Development

No branches or pull requests

10 participants