NixOS-Config/nixos/services/openssh.nix

22 lines
374 B
Nix
Raw Normal View History

2024-08-24 22:16:51 -04:00
{
# Enable SSH
services = {
openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PrintLastLog = "no";
PasswordAuthentication = false;
};
};
# Block nefarious SSH connections
fail2ban = {
enable = true;
maxretry = 5;
bantime = "5m";
ignoreIP = [ "10.0.0.0/24" ];
};
};
}