systemd socket activation to create a permanent SSH tunnel

R. Diez rdiez-2006 at rd10.de
Sun Mar 29 19:21:26 AEDT 2026


> [...]
> I posted a WIP patch to support this [1] some time ago but never got any feedback on it.

OK, thanks for the information.


>> Does "ssh" (the SSH client) support LISTEN_FDS too? I could not find any
>> mention of LISTEN_FDS in its documentation.
> 
> No - ssh doesn't support LISTEN_FDS; ssh isn't a daemon and IMO it doesn't make much sense to activate it as one.

Now, that is a strange thing to say. I just posted a relatively common scenario where the ssh "client" acts as a daemon for a "fixed" tunnel configuration.

Tools like autossh are designed for that "service" scenario with tunnels and the like. And the existence of ssh's command-line option "-f" ("requests ssh to go to background"), is a strong hint that this tool is sometimes used as a background service. That kind of option actually is called "--daemonize" in other such tools.

Regards,
   rdiez


More information about the openssh-unix-dev mailing list