mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 06:30:18 +02:00
26 lines
387 B
Nix
26 lines
387 B
Nix
{
|
|
config,
|
|
|
|
...
|
|
}:
|
|
{
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
PasswordAuthentication = false;
|
|
KbdInteractiveAuthentication = false;
|
|
PermitRootLogin = "no";
|
|
};
|
|
};
|
|
|
|
services.fail2ban.jails.sshd.settings = {
|
|
ssh = ''
|
|
enabled = true
|
|
port = ssh
|
|
filter = sshd
|
|
logpath = %(sshd_log)s
|
|
maxretry = 5
|
|
'';
|
|
};
|
|
|
|
}
|