add nova
This commit is contained in:
parent
1c272b7ec1
commit
49237cd86d
1 changed files with 152 additions and 55 deletions
|
|
@ -1,16 +1,28 @@
|
|||
let
|
||||
port = 2222;
|
||||
in
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
users.users.quadradical.openssh.authorizedKeys.keys = import ../../secrets/keys.nix;
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ port ];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = [ "quadradical" ];
|
||||
PermitRootLogin = "no";
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = [ "quadradical" ];
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
|
||||
fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
ignoreIP = [ "192.168.0.0/16" ];
|
||||
bantime = "6h";
|
||||
bantime-increment = {
|
||||
enable = true;
|
||||
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
|
||||
maxtime = "240h";
|
||||
overalljails = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue