nix-dotfiles/services/ssh.nix

33 lines
698 B
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
{
environment.systemPackages = [
pkgs.openssh
pkgs.endlessh
pkgs.sshguard
];
services.openssh = {
enable = true;
settings.UseDns = true;
settings.PermitRootLogin = "prohibit-password";
startWhenNeeded = true;
ports = [ 6969 ];
openFirewall = true;
2023-12-06 22:21:44 +01:00
#settings.Ciphers = [
# "chacha20-poly1305@openssh.com"
# "aes256-gcm@openssh.com"
# "aes128-gcm@openssh.com"
# "aes256-ctr"
# # remove some weaker ciphers
#];
};
services.endlessh = {
enable = true;
port = 22;
openFirewall = true;
};
services.sshguard.enable = true; #protection against brute force attacks like fail2ban
}