Enable host key generation on first boot #18
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fsagbuya/nix-servo:hostkey"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add a patch to enable host key generation on first boot rather than using the SSH keys from the not-os repo.
Note: Each time the SD image is rebuilt, the SSH key generation process will restart.
I don't think the static host keys are ever a good idea. Just generate on first boot at all times.
Understood. Will omit the the static part.
2a4fe846cc
to53b528a37e
@ -0,0 +48,4 @@
+ ${pkgs.openssh}/bin/ssh-keygen -t rsa -b 2048 -f $RSA_KEY -N ""
+ fi
+ if [ ! -f $ED25519_KEY ]; then
+ ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $ED25519_KEY -N ""
Do we need both types? I think all modern SSH supports ed25519.
Will just use
ed25519
then.@ -0,0 +32,4 @@
let
sshd_config = pkgs.writeText "sshd_config" ''
- HostKey /etc/ssh/ssh_host_rsa_key
- HostKey /etc/ssh/ssh_host_ed25519_key
Why remove?
If not removed, these lines seems to cause the keygen to run every time the machine reboots.
Why?
I tested again and there's no need to remove these lines. I guess I mistakenly rebuild the image before, that's why the keygen restarted. Will add them again. Apologies.
@ -15,6 +15,7 @@
src = not-os;
patches = [
./network.patch
./host-keys.patch
This could be a not-os PR, IIRC someone had even filed an issue about it.
I see. I just thought the owner have some use case why he is using the static host keys. Will add to the not-os PR then.
53b528a37e
tobd4885c597