Add fail2ban

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-03-07 10:15:37 +00:00
parent 2cf48bf516
commit e227cab2d7

View File

@@ -1,15 +1,27 @@
{ ... }: { ... }:
{ {
services.openssh = { environment = {
enableAllTerminfo = true;
persistence."/persist"."/var/lib/fail2ban" = { };
};
services = {
openssh = {
enable = true; enable = true;
ports = [ 22 ];
openFirewall = true;
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
PermitRootLogin = "no";
PrintMotd = false; PrintMotd = false;
}; };
}; };
environment.enableAllTerminfo = true; fail2ban = {
enable = true;
bantime = "24h";
bantime-increment = {
enable = true;
maxtime = "720h";
overalljails = true;
};
};
};
} }