How to configure GnuPG's S.gpg-agent socket location?

10,672

Since GnuPG Version 2.1.1 there exists a solution: Place a simple text-file S.gpg-agent in the gpg-homedir with following content:

%Assuan%
socket=/path/to/where/ever/you/want/S.gpg-agent

It replaces some evnvars like ${HOME} or ${HOSTNAME}

Be careful, when using a subdirectory of /tmp, because gpg-agent will not create needed directories.

Further reading at: https://dev.gnupg.org/T1752

Share:
10,672

Related videos on Youtube

Kalle Richter
Author by

Kalle Richter

Updated on September 18, 2022

Comments

  • Kalle Richter
    Kalle Richter over 1 year

    GnuPG places its socket S.gpg-agent at ~/.gnupg/S.gpg-agent by default. I didn't find any way to configure the location of this socket nor seems there to be a manpage of gpg.conf.

    Background: I want to symlink ~/.gnupg to an OpenAFS mount which doesn't support sockets (and avoid to create a symlink for every file in ~/.gnupg (which is a workaround) instead of just ~/.gnupg), i.e. find the most elegant solution imo.

  • mirabilos
    mirabilos over 4 years
    This no longer works, cf. bugs.debian.org/935966
  • Jamie
    Jamie about 3 years
    I'd be interested in knowing why this answer was down-voted.
  • Jamie
    Jamie about 3 years
    Unfortunately, for Windows, it never did. In assuan-socket.c in libassuan, it has "#ifndef HAVE_W32 SYSTEM" around that functionality. I could really use that functionality right now.
  • Hirnhamster
    Hirnhamster about 2 years
    Would also like to understand the downvote? It works as expected and I ran into the exact same issues. Without the additional files mentioned in the comment I would get ` error binding socket to` errors for the S.gpg-agent.extra and S.gpg-agent.ssh