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 = {
enable = true;
ports = [ 22 ];
openFirewall = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
PrintMotd = false;
};
environment = {
enableAllTerminfo = true;
persistence."/persist"."/var/lib/fail2ban" = { };
};
environment.enableAllTerminfo = true;
services = {
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PrintMotd = false;
};
};
fail2ban = {
enable = true;
bantime = "24h";
bantime-increment = {
enable = true;
maxtime = "720h";
overalljails = true;
};
};
};
}