feat(openssh): reconfigure hardening based on nixos wiki reccomendations

This commit is contained in:
Will Holdsworth 2026-03-09 17:41:04 +11:00
parent c6135ee301
commit 383989516c
Signed by: will-holdsworth
SSH key fingerprint: SHA256:Ykee8aymMJNAiYeeEmiwcIzkA1wgd4v8OZcWGxjq12c

View file

@ -42,18 +42,22 @@
}; };
# hardened openssh # hardened openssh
services.openssh = { services = {
allowSFTP = false; fail2ban.enable = true;
extraConfig = '' endlessh = {
AllowTcpForwarding yes enable = true;
X11Forwarding no port = 22;
AllowAgentForwarding no openFirewall = true;
AllowStreamLocalForwarding no };
AuthenticationMethods publickey openssh = {
''; enable = true;
settings = { ports = [ 5011 ];
KbdInteractiveAuthentication = false; settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
AllowUsers = [ "srv" ];
};
}; };
}; };