Discussion:
OpenSSH_6.7p1 Debian-5+deb8u2 unix socket forwarding: Warning: remote port forwarding failed for listen path /home/sithglan/.gnupg/S.gpg-agent
(too old to reply)
Thomas Glanzmann
2016-07-20 09:06:44 UTC
Permalink
Hello,
I would like to forward my gpg-agent from a local workstation using a
remote machine:

(x1) [~] ssh -o "StreamLocalBindUnlink=yes" -R /home/sithglan/.gnupg/S.gpg-agent:/home/sithglan/.gnupg/S.gpg-agent remote.machine.de

when I do the same, I get the following error message:

Warning: remote port forwarding failed for listen path /home/sithglan/.gnupg/S.gpg-agent

From my understanding StreamLocalBindUnlink=yes should delete the remote
listining socket before forwarding it. On the web other user report that
it is broken and someone should use a ~/.ssh/rc file to fight the
symptoms. My question is: Should it work like the above? Am I doing
something wrong? Is it fixed in a newer version and should I upgrade?

I'm using Debian Jessie 64 Bit, but fine with updating or patching sshd
to enable above usecase. Otherwise I'll go with the ~/.ssh/rc file.

Cheers,
Thomas
Thomas Glanzmann
2016-07-20 11:30:23 UTC
Permalink
Hello everyone,
Post by Thomas Glanzmann
(x1) [~] ssh -o "StreamLocalBindUnlink=yes" -R /home/sithglan/.gnupg/S.gpg-agent:/home/sithglan/.gnupg/S.gpg-agent remote.machine.de
Warning: remote port forwarding failed for listen path /home/sithglan/.gnupg/S.gpg-agent
to answer my own question. StreamLocalBindUnlink exists for client and
for server. In order to make a remote port forwarding work with an
existing socket, it needs to be enabled in the server, not in the
client. So the following works:

(infra) [~] grep StreamLocalBindUnlink /etc/ssh/sshd_config
StreamLocalBindUnlink yes
(infra) [~] /etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.

Afterwards it works like a charm.

Cheers,
Thomas

Loading...