Discussion:
Unix socket support for sshd
(too old to reply)
Mantas Mikulėnas
2016-02-19 08:35:37 UTC
Permalink
Note that the daemon management service (what systemd's pid 1 provides)
needs some way to communicate to the spawned daemon which file
descriptors it has inherited should be treated as listeners. for
systemd, this is a contiguious block of file descriptors starting at fd
3 (SD_LISTEN_FDS_START), and the enviornment variable LISTEN_FDS is a
decimal number indicating how many file descriptors to use for listening
(see sd_listen_fds(3) from libsystemd for more detail).
A reasonable approach that would avoid linking in libsystemd might be to
just specify something like ListenFDs N:M (meaning file descriptors N
through M are sockets you should listen on). (perhaps -L N:M on the
command line, so that the config file could stay static and the spawning
daemon manager could dynamically adjust the invocation as sockets were
added or removed)
--dkg
FWIW, for single-socket configurations, systemd also supports the
inetd-compatible style of assigning the socket directly to fd's 0-2 (stdio).

I've tested it with both `sshd -i` in Accept=yes ("nowait") mode, and
with Exim4 in Accept=no ("wait") mode. It works fine with `sshd -i`.

Also, I assume the scary key generation warning in sshd's manpage only
applies to protocol 1?
--
Mantas Mikulėnas <***@gmail.com>

[Not sure if this'll reach the list via GMANE, but here goes.]
Darren Tucker
2016-02-19 10:07:21 UTC
Permalink
On Fri, Feb 19, 2016 at 7:35 PM, Mantas Mikulėnas <***@gmail.com> wrote:
[...]
Post by Mantas Mikulėnas
Also, I assume the scary key generation warning in sshd's manpage only
applies to protocol 1?
Yes. Protocol 2 uses Diffie-Hellman to create the session key and
does not need an ephemeral server key. Damien added some text about 6
months ago to clarify, it currently reads "If SSH protocol 1 is
enabled, sshd should not normally be run from inetd..."
--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
Continue reading on narkive:
Search results for 'Unix socket support for sshd' (Questions and Answers)
5
replies
Replace or upgrade?
started 2014-08-31 07:40:38 UTC
desktops
Loading...