Problem with unix socket forwarding

Andrew Gallagher andrewg at
Tue Sep 22 14:08:35 CEST 2015

Hi, all.

I've been trying to get gpg-agent forwarding working between my laptop
and a remote VM. Using the new unix socket forwarding in openssh 6.7, I
have defined the following script:

ssh -R /home/andrewg/.gnupg/S.gpg-agent:$( echo $GPG_AGENT_INFO | sed
's/:.*//g' ) -o "ControlMaster=no" -o "ControlPath=no" -o
"StreamLocalBindUnlink=yes" $*

gpg-agent on the VM indicates that the socket is live, but gpg2 reports
no private keys available. I have one local and one smartcard private
key working perfectly on the laptop (see below).

Anyone know where I'm going wrong?

On a side note, the option StreamLocalBindUnlink=yes appears to do
nothing, meaning I'm constantly having to rm .gnupg/S.gpg-agent - any
help with that would also be appreciated. ;-)

Thanks in advance,


agallagher at itchy:~$ gpg2 --list-secret-keys
sec   2048R/0xD5BF93B014A49700 2013-03-14 [expires: 2018-03-14]
      Key fingerprint = FB29 3A52 9FEB 41D7 B7C8  7B49 D5BF 93B0 14A4 9700
uid                            Andrew Gallagher <andrew.gallagher at>
ssb   2048R/0xACB387E2BD11B295 2013-03-14
ssb   2048R/0xDE32C1F5C819C504 2013-10-23

sec#  4096R/0xFB73E21AF1163937 2013-07-02 [expires: 2017-01-20]
      Key fingerprint = 00CC 54C6 A0C6 0169 1AF4  931F FB73 E21A F116 3937
uid                            Andrew Gallagher <andrewg at>
uid                            Andrew Gallagher <andrewg at>
uid                            Andrew Gallagher <ab.gallagher at>
uid                            [jpeg image of size 18803]
ssb>  4096R/0x6B09069314549D4B 2013-07-02
ssb>  4096R/0x5C1EC404D5906629 2015-04-26
ssb>  4096R/0x85FDF561DA8C0C46 2015-04-26

agallagher at itchy:~$ gpgforward nex
No mail.
Last login: Mon Sep 21 15:16:26 2015 from itchy

andrewg at xen:~$ gpg-agent
gpg-agent: gpg-agent running and available
andrewg at xen:~$ gpg2 --list-secret-keys
andrewg at xen:~$

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20150922/063d04f4/attachment.sig>

More information about the Gnupg-users mailing list