4

I use pass utility in Ubuntu to store my passwords. On my native machine, when I try to access a password using pass it pops up a window asking for the passphrase the first time and any subsequent time it remembers it. This is a all fine so far. The problem is when I ssh into my Ubuntu machine (let's say using putty), I can't access my passwords using pass. I think it's trying to open the passphrase window but it can't. How can I enter the passphrase manually or force it to ask me the passphrase in the command line?

PS. None of the suggested methods work for me. For example none of the solutions here work: Enter SSH passphrase once

EDIT: pass uses gnupg and based on this link, it seems it's really hard to work around gpg window pop up: https://lists.gnupg.org/pipermail/gnupg-users/2018-February/059914.html

This link suggests adding export GPG_TTY=$(tty) export PINENTRY_USER_DATA="USE_CURSES=1" to .bashrc but this doesn't help either: https://gpgtools.tenderapp.com/discussions/problems/50502-how-to-avoid-pinentry-pop-up-window-when-using-terminal

The solution here doesn't work either: https://dilawarnotes.wordpress.com/2013/02/13/disable-gpg-gui-asking-for-paraphrase/

Arash Fotouhi
  • 161
  • 1
  • 1
  • 6

2 Answers2

2

I found an answer on StackOverflow that did the magic. Here's the link: https://stackoverflow.com/a/53641081/1708426

Arash Fotouhi
  • 161
  • 1
  • 1
  • 6
2

On Ubuntu 20.04 change pinentry to pinentry-curses with the command below then select pinentry-curses option. Do the same but select pinentry-gnome3 to restore default pinentry.

$ sudo update-alternatives --config pinentry
There are 2 choices for the alternative pinentry (providing /usr/bin/pinentry).

  Selection    Path                      Priority   Status
------------------------------------------------------------
  0            /usr/bin/pinentry-gnome3   90        auto mode
* 1            /usr/bin/pinentry-curses   50        manual mode
  2            /usr/bin/pinentry-gnome3   90        manual mode

Press <enter> to keep the current choice[*], or type selection number:
cambussi
  • 21
  • 1