SYSTEMD-SSH-GENERATOR(8)
๐ SYSTEMD-SSH-GENERATOR ๐
okay bestie, pull up a chair, because this is systemd-ssh-generator from the systemd-ssh-generator manual and it is so much cooler than it sounds. it's a generator. it makes SSH happen in places SSH doesn't normally happen. no cap. ๐ฆ
โจ NAME โจ
systemd-ssh-generator โ a generator that binds a socket-activated SSH server to local AF_VSOCK and AF_UNIX sockets. literally its whole personality. ๐
โจ SYNOPSIS โจ
/usr/lib/systemd/system-generators/systemd-ssh-generator
that's it. that's the whole invocation. she just runs. ๐
โจ DESCRIPTION โจ
okay so here's the tea. systemd-ssh-generator binds a socket-activated SSH server to local AF_VSOCK and AF_UNIX sockets โ but only under certain conditions, bestie. and it only does anything at all if the sshd(8) binary is installed. no sshd, no vibes.
specifically, she does this:
- if she's invoked in a VM with
AF_VSOCKsupport, a socket-activated SSH per-connection service gets bound toAF_VSOCKport22. ๐ - if she's invoked in a container environment with a writable directory
/run/host/unix-export/pre-mounted, she binds SSH to anAF_UNIXsocket at/run/host/unix-export/ssh. the assumption (iykyk) is that this directory is bind mounted to the host side as well, so you can use it to connect to the container from there. check out Container Interface[1] for more about this interface. ๐ซถ - a local
AF_UNIXsocket at/run/ssh-unix-local/socketis also bound โ unconditionally, like she's not asking permission. this one is for SSH communication from the host to itself, no networking involved, for example to traverse security boundaries safely and with secure authentication. iconic behavior honestly. โจ - additional
AF_UNIXandAF_VSOCKsockets are optionally bound, based on thesystemd.ssh_listen=kernel command line option or thessh.listensystem credential (more on those below). ๐ธ
want to actually connect to these sockets with the ssh client? see systemd-ssh-proxy(1) for the deets.
also: the ssh.authorized_keys.root credential can be used to allow specific public keys to log in over SSH. see systemd.system-credentials(7) for more info. ๐ฅ
and here's a cute implementation detail: the generator will use a packaged sshd@.service service template file if one exists, and otherwise she'll generate a suitable service template file herself. self-sufficient queen. ๐
last thing: systemd-ssh-generator implements systemd.generator(7). periodt.
โจ KERNEL COMMAND LINE โจ
systemd-ssh-generator understands the following kernel-command-line(7) parameters:
systemd.ssh_auto=โ this option takes an optional boolean argument, and defaults toyes. if enabled, the automatic binding to theAF_VSOCKandAF_UNIXsockets listed above happens. if disabled, it does not happen โ except for those explicitly requested viasystemd.ssh_listen=on the kernel command line or via thessh.listensystem credential. ๐
Added in version 256.
systemd.ssh_listen=โ this option configures an additional socket to bind SSH to. you can use it multiple times to bind multiple sockets, so go off. the syntax should follow the one ofListenStream=, seesystemd.socket(5)for details. this functionality supports all socket familiessystemd(1)supports, includingAF_INETandAF_INET6. ๐
Added in version 256.
โจ CREDENTIALS โจ
systemd-ssh-generator supports the system credentials logic, bestie. the following credentials are used when passed in:
ssh.listenโ this credential should be a text file, with each line referencing one additional socket to bind SSH to. the syntax should follow the one ofListenStream=, seesystemd.socket(5)for details. this functionality supports all socket families systemd supports, includingAF_INETandAF_INET6. ๐
Added in version 256.
ssh.ephemeral-authorized_keys-allโ provides additional public keys, given in the customaryauthorized_keysformat, for all users, for incoming connections via the generatedAF_VSOCKandAF_UNIXsocket units. ๐
the intended use of this is for a host system (in either VM or container configurations) to generate a keypair and inject the public key into the guest, using the private key to connect to any user account on the guest via ssh, without further authentication. yes, that's a lot of power, she's aware.
Added in version 256.
โจ SEE ALSO โจ
systemd(1), kernel-command-line(7), systemd.system-credentials(7), vsock(7), unix(7), ssh(1), sshd(8)
โจ NOTES โจ
- Container Interface https://systemd.io/CONTAINER_INTERFACE
quick vibe check: this page lives in systemd 262.1, and honestly? she ate. go bind some sockets bestie ๐ ๐ง๐ธ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms