From ArchWiki
Revision as of 15:50, 23 June 2016 by Scimmia (talk | contribs) (gpg-agent socket path: sign)
Jump to navigation Jump to search

gpg-agent socket path

Under the SSH agent section, no matter if I set GNUPGHOME to ~/.gnupg or not, my gpg-agent does not work for SSH because the S.gpg-agent.ssh is not create in my ~/.gnupg directory. The S.gpg-agent.ssh file is created at /run/user/$UID/gnupg. If GNUPGHOME needs to be a specific directory such as /run/user/$UID/gnupg or a symlink needs to exist in the ~/.gnupg directory then that should be explained in the wiki article.

—This unsigned comment is by Dmp1ce (talk) 14:43, 23 June 2016‎. Please sign your posts with ~~~~!

I can't find any reference of gpg using /run/user/$UID/gnupg by default. How do you start gpg-agent and what is in your gpg-agent.conf? -- Lahwaacz (talk) 14:47, 23 June 2016 (UTC);a=commit;h=aab8a0b05292b0d06e3001a0b289224cb7156dbd
Scimmia (talk) 14:49, 23 June 2016 (UTC)
I start with gpg-connect-agent /bye >/dev/null 2>&1 Dmp1ce (talk)
My gpg-agent.conf
# Cache settings
default-cache-ttl 10800
default-cache-ttl-ssh 10800

# Enable SSH support

# Keyboard control
# PIN entry program
#pinentry-program /usr/bin/pinentry-curses
#pinentry-program /usr/bin/pinentry-qt4
#pinentry-program /usr/bin/pinentry-kwallet
#pinentry-program /usr/bin/pinentry-gtk-2

# For duply
--Dmp1ce (talk) 15:02, 23 June 2016 (UTC)
OK, thank you for correcting me. I've added the rest of the story, closing. -- Lahwaacz (talk) 15:27, 23 June 2016 (UTC)
Pretty sure this isn't correct. Everything says it will use /run/usr/$UID/ if it exists, and systemd uses it, so it exists on every (supported) Arch system.
Scimmia (talk) 15:34, 23 June 2016 (UTC)
The commit message says:
To cope with non standard homedirs (via GNUPGHOME or --homedir) the
SHA-1 hash of the homedir is computed, left truncated to 120 bits,
zBase-32 encoded, prefixed with "d.", and appended to
"[/var]/run/user/$(id -u)/gnupg/".  If that directory exists and has
proper permissions it is returned as socket dir - if not the homedir
is used.  Due to cleanup issues, this directory will not be
auto-created but needs to be created by the user in advance.
That's also the reason why the --create-socketdir and --remove-socketdir commands were added to gpgconf, as mentioned in the changelog.
-- Lahwaacz (talk) 15:41, 23 June 2016 (UTC)
Ah, to run multiple agents. Got it, thanks. Scimmia (talk) 15:50, 23 June 2016 (UTC)