diff options
| author | tv <tv@krebsco.de> | 2026-11-20 15:55:20 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 15:55:20 +0000 |
| commit | a556852dd550fc0676708b89f9f0fcd6ff015250 (patch) | |
| tree | 2b5391a2ebeedf8985a871a95b62c2397ea80d1e /README.md | |
| parent | 4f5ef7b716c6bf01380e44c6f270f7c02aa5b479 (diff) | |
run-firecracker-vm: sshd, with a host key from the host
The guests run sshd, started on demand, with an ed25519 host key that
isn't in the store: the run script takes it from --ssh-host-key FILE, by
default ~/.local/share/run-firecracker-vm/ssh_host_ed25519_key, created
on first use, so a user's guests share one key and one known_hosts line
covers them (see README.md), and serves a copy from its private
temporary directory via 9P on vsock port 567. In the guest,
fc-ssh-host-key copies it to /run/ssh (0600) before sshd starts, and
unmounts the share again. Who may log in is up to a layer
(users.users.<name>.openssh.authorizedKeys).
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -87,6 +87,23 @@ not show up while the guest runs). Other modes: `mmap`, `readahead`, The guest gets 2 CPUs and 1024 MiB unless told otherwise (`--vcpus N`, 1 to 32; `--mem-size MIB`). +The guests run sshd. Its host key comes from the host at boot, so it's +not in the store: `--ssh-host-key FILE`, by default +`~/.local/share/run-firecracker-vm/ssh_host_ed25519_key`, created on first +use, so all your guests have the same one, and one known_hosts line does: + +```sh +echo "172.16.0.*,fdfc:fc::* $(cut -d' ' -f1,2 ~/.local/share/run-firecracker-vm/ssh_host_ed25519_key.pub)" >> ~/.ssh/known_hosts +``` + +Who may log in goes in a layer, e.g.: + +```nix +{ users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA..." ]; } +``` + +A guest on tap fctapN is 172.16.0.(N+2) (see `fc-egress vms`). + The guest's system can be built in layers, each a NixOS module on top of the ones before (the first on top of the base system): |
