commit 88ba72fe278d306e89ec68de4eb797984141b472
parent 68de03afc27f38fc9dff55bd18fd0a2b1e904aab
Author: breadcat <breadcat@users.noreply.github.com>
Date: Sun, 3 Aug 2025 15:54:30 +0100
Add fail2ban service
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/common/ssh.nix b/common/ssh.nix
@@ -1,11 +1,14 @@
{ username, sshkey, ... }:
{
+ # SSH service
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
-
- # SSH key
+ # Fail2ban service
+ services.fail2ban.enable = true;
+ # Import SSH key
users.users.${username}.openssh.authorizedKeys.keys = [ "${sshkey}" ];
+
}
\ No newline at end of file