1

I'm trying to set up pass and hitting a bit of a wall. I generated a new gpg key with gpg --gen-key and then ran pass init 1E3C5C98 where 1E3C5C98 is the ID for my new key, at least as I understand it. It acts like it worked:

mkdir: created directory '/home/amanda/.password-store/'
Password store initialized for 1E3C5C98

And I can add new passwords with pass insert Example/username but when I try to view them I get gpg: decryption failed: No secret key -- I can't figure out how to tell pass what my gpg passhprase is, and pass isn't asking me for it. I read through the pass docs but I'm finding an answer there. I suspect I'm missing something super obvious.

The pass developers recommend gpg-agent but I'm also not totally sure how to tell gpg-agent to unlock my gpg key.

Per the comments, I tried running pass Example/username through strace -- I can add a password just fine with pass insert Example/username but when I try to view the password I see the "no secret key" error.

amanda@mona:~$ strace -e execve -F pass Example/username
execve("/usr/bin/pass", ["pass", "Example/username"], [/* 66 vars */]) = 0
execve("/usr/local/sbin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = -1 ENOENT (No such file or directory)
execve("/bin/bash", ["bash", "/usr/bin/pass", "Example/username"], [/* 66 vars */]) = 0
strace: Process 1388 attached
strace: Process 1389 attached
[pid  1389] execve("/usr/bin/tty", ["tty"], [/* 65 vars */]) = 0
[pid  1389] +++ exited with 0 +++
[pid  1388] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1389, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid  1388] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1388, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 1390 attached
[pid  1390] execve("/usr/bin/which", ["which", "gpg2"], [/* 66 vars */]) = 0
[pid  1390] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1390, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 1391 attached
[pid  1391] execve("/usr/bin/getopt", ["getopt", "-o", "c", "-l", "clip", "-n", "pass", "--", "Example/username"], [/* 68 vars */]) = 0
[pid  1391] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1391, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 1394 attached
[pid  1394] execve("/usr/bin/gpg2", ["gpg2", "-d", "--quiet", "--yes", "--compress-algo=none", "--no-encrypt-to", "--batch", "--use-agent", "/home/amanda/.password-store/Exa"...], [/* 68 vars */]) = 0
gpg: decryption failed: No secret key
[pid  1394] +++ exited with 2 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1394, si_uid=1000, si_status=2, si_utime=0, si_stime=0} ---
+++ exited with 2 +++

Note: I think this might be related: gpg problem in using pass password manager / pass and gpg: No public key

4
  • 1
    you need to re-importing the private key firstly, gpg --import myprivatekey.asc then editing ~/.gnupg/gpg.conf and add pinentry-mode loopback Dec 31, 2017 at 22:26
  • Umm... I don't have a solution. But I might suggest strace -e execve -F pass insert Example/username to work out precisely how gpg is being called.
    – Att Righ
    Dec 31, 2017 at 22:30
  • @AttRigh added that output.
    – Amanda
    Jan 1, 2018 at 0:33
  • 1
    Found the answer on another question. Voting to close this as a duplicate.
    – Amanda
    Jan 1, 2018 at 0:58

0

Browse other questions tagged .