pass.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Pass Says I Have No Secret Key</title>
  6. <link rel="shortcut icon" href="/csh/favicon.ico" type="image/x-icon"/>
  7. <link rel="stylesheet" type="text/css" href="/csh/stylesheet.css"/>
  8. </head>
  9. <body>
  10. <header>
  11. <p><a href="/csh"><img src="/csh/homeicon" alt="csh"/></a></p>
  12. </header>
  13. <h1>Pass Says I Have No Secret Key</h1>
  14. <p>
  15. A while ago, I moved to another GNU+Linux distribution and took my
  16. files with me. I put all my important files in a tarball and
  17. extracted them onto the new system in their respective places.
  18. Someone said moving my GPG dir could be the problem.</p>
  19. <p>
  20. I'm new to Pass. Before switching to it, I
  21. used <a href="https://getvau.lt/">Vault</a> to generate my
  22. passwords. In fact, all my current passwords are still generated by
  23. it. But, I put them in Pass too. So, I'm not losing anything by
  24. using Pass... yet. That said, I'd still like to fix the
  25. problem before it becomes serious.</p>
  26. <p>
  27. Note: my private key <em>does</em> work in both Evolution and the
  28. plain command line interface to GPG.</p>
  29. <p>
  30. I went to #pass on Freenode. Demure linked to
  31. the <a href="https://wiki.gnupg.org/GnomeKeyring">GnuPG wiki</a>,
  32. which gave the following solution:</p>
  33. <pre>
  34. sudo dpkg-divert --local --rename \
  35. --divert /etc/xdg/autostart/gnome-keyring-gpg.desktop-disable \
  36. --add /etc/xdg/autostart/gnome-keyring-gpg.desktop
  37. </pre>
  38. <p>
  39. Result:</p>
  40. <pre>
  41. Adding 'local diversion of /etc/xdg/autostart/gnome-keyring-gpg.desktop to /etc/xdg/autostart/gnome-keyring-gpg.desktop-disable'
  42. </pre>
  43. <p>
  44. Even after this, I still get the same error:</p>
  45. <pre>
  46. cal@leela:~$ pass show freepo.st
  47. gpg: WARNING: unsafe permissions on homedir '/home/cal/.gnupg'
  48. gpg: decryption failed: No secret key
  49. </pre>
  50. <p>
  51. mitfree asked about the file permissions on my GPG directory, to see
  52. if that was the problem.</p>
  53. <pre>
  54. cal@leela:~$ vdir ~/.gnupg
  55. lrwxrwxrwx 1 cal cal 20 Oct 25 23:24 /home/cal/.gnupg -> Stow/CRITICAL/.gnupg
  56. </pre>
  57. <p>
  58. He said this was <q>not safe</q>.</p>
  59. <p>
  60. I can see why. Ubuntu lets users see each other's files by default,
  61. except for a few known important dirs like mail and SSH. If I had
  62. multiple users on this system, I'd be in trouble.</p>
  63. <p>
  64. mitfree linked to
  65. a <a href="https://superuser.com/questions/954509/what-are-the-correct-permissions-for-the-gnupg-enclosing-folder-gpg-warning#954536">superuser.com
  66. thread</a> about fixing the file permissions on the GPG directory.
  67. The following commands were done.</p>
  68. <pre>
  69. chown -R $(whoami) ~/.gnupg/
  70. chmod 600 ~/.gnupg/*
  71. chmod 700 ~/.gnupg
  72. </pre>
  73. <p>
  74. They completed without error. The permission warning went away, but
  75. decryption still failed.</p>
  76. <blockquote>
  77. <p>
  78. Addition: Actually vdir showed that the unix rights on a symbolic link
  79. (or short "symlink") are lrwxrwxrwx. This is perfectly normal for the
  80. link itself.
  81. More important would have been the output for the target directory,
  82. in this case Stow/CRITICAL/.gnupg.<br>
  83. However, running chown on the symlink actually changes the rights for
  84. the target, so the fixed worked in this case, but usually using the
  85. real path might be a better idea.
  86. </p>
  87. <small class="author">holgersson</small> <!-- https://stackoverflow.com/a/10238819 -->
  88. </blockquote>
  89. <hr/>
  90. <footer>
  91. <p>Last updated: 2017-11-27 10:43:03 CST.</p>
  92. <p>
  93. Copyright 2017 Caleb Herbert under the terms of the
  94. <a href="https://creativecommons.org/licenses/by/4.0/">Attribution
  95. 4.0 International</a> license.</p>
  96. </footer>
  97. </body>
  98. </html>