Public version of @psyclyx's homelab nix configuration.
ssh-keygen -t ed25519 -N "" -C "" -f /etc/ssh/id_ed25519_host_key
ssh-keygen -t ed25519 -N "" -C "" -f /etc/secrets/initrd/id_ed25519_host_keyssh-keygen -t ed25519 -N "" -C "user@host" -f ~/.ssh/id_ed25519ssh-keygen -y -f /etc/ssh/id_ed25519ssh-keygen -t ed25519 -N "" -C "my-ca" -f ca_keyssh-keygen -s ca_key -I "hostname" -h -n "hostname,hostname.example.com" host_key.pub
# produces host_key-cert.pub-hmarks it as a host certificate-nsets valid principals (hostnames)-V +52wto set validity (optional, default unlimited)
ssh-keygen -s ca_key -I "user@example.com" -n "root,deploy" user_key.pub
# produces user_key-cert.pub-nsets valid principals (usernames the cert can log in as)-V +90dto set validity
ssh-keygen -L -f key-cert.pubwg genkey > private.key
chmod 600 private.keywg pubkey < private.key > public.keywg genpsk > preshared.key