feat: automate SSH config ('known_hosts', 'authorized_keys' ...)

This commit is contained in:
2026-03-11 21:25:32 +01:00
committed by hektor
parent fbdcf51e6c
commit 66f36cf71c
15 changed files with 143 additions and 9 deletions
+8
View File
@@ -4,9 +4,17 @@ let
cfg = config.services.openssh;
in
{
imports = [
./known-hosts.nix
./authorized-keys.nix
./extract-keys.nix
];
options.services.openssh.harden = mkEnableOption "harden ssh server configuration";
config = {
networking.firewall.allowedTCPPorts = [ 22 ];
services.openssh.settings = optionalAttrs cfg.harden {
PermitRootLogin = "no";
PasswordAuthentication = false;