!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

579 Members
NixOS ❤️ systemd159 Servers

Load older messages


SenderMessageTime
6 Mar 2025
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgclearly I don't understand systemd-ssh-generator and its relationship to vsoc19:42:06
@elvishjerricco:matrix.org@elvishjerricco:matrix.org* clearly I don't understand systemd-ssh-generator and its relationship to vsock19:42:08
@gdamjan:spodeli.orggdamjanand on my Arch VM - seems to be generated by default19:42:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgneeding to load a module means the generator won't do the right thing19:43:12
@gdamjan:spodeli.orggdamjan for the client side (ssh client, but actually VM host), you need the systemd-ssh-proxy executable and some ssh config magic (shipped with systemd) 19:43:14
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgi'm so confused19:43:53
@gdamjan:spodeli.orggdamjanah, and also the generator needs to find that sshd is "installed"19:44:29
@gdamjan:spodeli.orggdamjannot sure, but didn't the kernel automatically load socket modules ?19:44:44
@elvishjerricco:matrix.org@elvishjerricco:matrix.org ok so we have a .socket unit, which depends on a vsock, and we're hoping the kernel auto-loads the module? 19:45:48
@elvishjerricco:matrix.org@elvishjerricco:matrix.org (really, the .socket unit should just depend on modprobe@whatever-the-vsock-module-is-called.service) 19:46:32
@gdamjan:spodeli.orggdamjanconsidering I haven't configured any vsock module to be loaded explicitly, and yet they are :)19:46:43
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
$ git grep vsock | wc -l
220

jfc

19:47:42
@elvishjerricco:matrix.org@elvishjerricco:matrix.org *
$ cd systemd
$ git grep vsock | wc -l
220

jfc

19:47:56
@gdamjan:spodeli.orggdamjanthe generator does seem to check that the system is a guest19:48:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgok so we've got some kind of option here19:49:10
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgdo we need the ssh generator?19:49:32
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * gdamjan: do we need the ssh generator? 19:49:39
@gdamjan:spodeli.orggdamjanin theory you can just add a static unit for vsock, right?19:49:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI don't understand19:50:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI thought we just don't need anything?19:50:31
@gdamjan:spodeli.orggdamjanhow do you mean? :D19:50:56
@gdamjan:spodeli.orggdamjansshd will not natively listen on vsock, so you need "something"19:51:09
@gdamjan:spodeli.orggdamjan
# /run/systemd/generator/sshd-vsock.socket
# Automatically generated by systemd-ssh-generator

[Unit]
Description=OpenSSH Server Socket (systemd-ssh-generator, AF_VSOCK)
Documentation=man:systemd-ssh-generator(8)
Wants=ssh-access.target
Before=ssh-access.target

[Socket]
ListenStream=vsock::22
Accept=yes
PollLimitIntervalSec=30s
PollLimitBurst=50
19:51:17
@gdamjan:spodeli.orggdamjanthis is the generated .socket unit ^19:51:26
@raitobezarius:matrix.orgraitobezarius
In reply to @arianvp:matrix.org
Not 100% sure. Raito will know
there's a generator thingie
19:51:56
@gdamjan:spodeli.orggdamjan

and the service

# /run/systemd/generator/sshd-generated@.service
# Automatically generated by systemd-ssh-generator

[Unit]
Description=OpenSSH Per-Connection Server Daemon
Documentation=man:systemd-ssh-generator(8) man:sshd(8)
[Service]
ExecStart=-/usr/bin/sshd -i -o "AuthorizedKeysFile ${CREDENTIALS_DIRECTORY}/ssh.ephemeral-authorized_keys-all .ssh>
StandardInput=socket
ImportCredential=ssh.ephemeral-authorized_keys-all
19:52:04
@raitobezarius:matrix.orgraitobezariusi can pull you my patch again if you need it19:52:06
@arianvp:matrix.orgArianI mean is vsock available without a kernel module19:52:18
@raitobezarius:matrix.orgraitobezariusyes19:52:21
@raitobezarius:matrix.orgraitobezariusvsock is always available in the kernel19:52:24

Show newer messages


Back to Room ListRoom Version: 6