The difference in experience between using pass
in a console (what you call a virtual terminal) and within a (GUI) terminal has nothing to do with pass
, but with the secret key management done for gpg
(as used in the pass
scripts) by the gpg-agent
.
This gpg-agent
is, in modern distributions automatically started with X. You can see this by doing env | fgrep GPG_AGENT
from a terminal and one of the consoles. On my Linux Mint 17, this is done by /etc/X11/Xsession.d/90gpg-agent
.
As the gpg-agent
's man
page tells you:
If you don't use an X server, you can also put this into your regular
startup file ~/.profile or .bash_profile. It is best not to run multi‐
ple instance of the gpg-agent, so you should make sure that only one is
running: gpg-agent uses an environment variable to inform clients about
the communication parameters. You can write the content of this envi‐
ronment variable to a file so that you can test for a running agent.
Here is an example using Bourne shell syntax:
gpg-agent --daemon --enable-ssh-support \
--write-env-file "${HOME}/.gpg-agent-info"
The 90gpg-agent
mentioned above is actually smart and tests whether the gpg-agent
is already running, but it defaults to using ~/.gnupg/gpg-agent-info-$(hostname)
.
If your distribution has a similar setup, then you should be able to add the above lines to your ~/.profile
(but be sure to use the PIDFILE matching with your X started gpg-agent
). You should, in also be able to use the same gpg-agent from multiple consoles by re-evaluating the .gpg-agent-info
file.
While trying to set this up, make sure you run pstree | grep -F pgp-agent
to make sure there are not more agents running than you need, otherwise it depends on the environment whether "pass
" asks for passwords agains and/or between different consoles
$DBUS_SESSION_BUS_ADDRESS
variable from your GUI session and setting it to the same value in your Virtual terminal. There's most likely a daemon running that stores the passwords and a$DBUS_SESSION_BUS_ADDRESS
is most likely how the client programs communicate with the daemon.unix:abstract=/tmp/dbus-6xONvYE5r7
. I tried setting that variable in the Virtual Terminal but as expected that alone doesn't fix the problem. Any other suggestions?export
ed too? E.g.,export DBUS_SESSION_BUS_ASSRESS="unix:abstract=/tmp/dbus-6xONvYE5r7"
? I'd also try setting and exportingexport DISPLAY=:0.0
. I think if it works in GUI pseudoterminals, these two exports should make it work in a virtual terminal too (while the GUI session is still on).DISPLAY
simply makes it so I can't see the password prompt anymore.