Remote port forwarding problem
Thomas Köller
thomas at krokinole.de
Sun Apr 12 00:56:05 AEST 2026
I am trying to achieve forwarding of a remote TCP network port to a
local AF_UNIX socket over a SSH connection, unsuccessfully. The
connection is successfully established, even with
'ExitOnForwardFailure=yes' given on the command line. It appears that
ssh thinks it succeeded in setting up the forwarding (see the lines
marked with <<< below) when actually it didn't, because the local socket
isn't created. Here's what I am doing:
[root at sarkovy config.d]# ssh -v -o 'ExitOnForwardFailure=yes' -R
'stratoserver.krokinole.de:smtp:/tmp/gollywog'
ssh://stratoserver.krokinole.de:3508
debug1: OpenSSH_10.0p2, OpenSSL 3.5.4 30 Sep 2025
--- A lot of irrelevant stuff deleted ---
Authenticated to stratoserver.krokinole.de ([82.165.124.192]:3508) using
"publickey".
debug1: pkcs11_del_provider: called, provider_id = (null)
debug1: Remote connections from stratoserver.krokinole.de:25 forwarded
to local address /tmp/gollywog:-2 <<<
debug1: ssh_init_forwarding: expecting replies for 1 forwards
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions at openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00 at openssh.com
want_reply 0
debug1: Remote: /root/.ssh/authorized_keys:4: key options:
agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /root/.ssh/authorized_keys:4: key options:
agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: remote forward success for: listen stratoserver.krokinole.de:25,
connect /tmp/gollywog:-2 <<<
debug1: forwarding_success: all expected forwarding replies received
debug1: Sending environment.
Linux stratoserver 6.12.74+deb13+1-amd64 #1 SMP PREEMPT_DYNAMIC Debian
6.12.74-2 (2026-03-08) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Apr 11 00:38:57 2026 from 31.18.63.92
root at stratoserver:~#
Then, while the connection is up, on another terminal:
[thomas at sarkovy openssh]$ ls /tmp/gollywog
ls: cannot access '/tmp/gollywog': No such file or directory
The local system is running Fedora 43 with SELinux enabled. However,
creating a file in /tmp should always work, and in fact ssh does not
report an error accessing that location. So what is wrong here?
More information about the openssh-unix-dev
mailing list