Skip to content

Instantly share code, notes, and snippets.

@kradalby
Created December 1, 2022 10:22
Show Gist options
  • Save kradalby/885ac44105114d64d066ad879e32b189 to your computer and use it in GitHub Desktop.
Save kradalby/885ac44105114d64d066ad879e32b189 to your computer and use it in GitHub Desktop.
SSH NixOS bootstrap
{pkgs, ...}: {
services.openssh = {
enable = true;
# require public key authentication for better security
passwordAuthentication = false;
kbdInteractiveAuthentication = false;
permitRootLogin = "yes";
};
users.users."root".openssh.authorizedKeys.keys = [
# kramacbook
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBV4ZjlUvRDs70qHD/Ldi6OTkFpDEFgfbXbqSnaL2Qup"
# dev.ntnu vm
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGyrauaLwnrgeR5mpeOBCw/creVh1dMU1a12TTXvQ+Rd"
# kraairm2
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqesfGzltPA+pNVQ667T1tKzQoz09qTcoQshygxl73I3EbYD5vnHFtC+tnziVbfxSx8ZDRvPDN7vHEalE5U3JU="
];
networking.firewall.enable = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment