confix/nixos/server_defense.nix

36 lines
719 B
Nix
Raw Normal View History

# All configuration.nix
{ config, lib, pkgs, inputs, user, ... }:
{
services = {
openssh = {
enable = true;
ports = [
22
8282
];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
allowSFTP = false; # Don't set this if you need sftp
extraConfig = ''
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
AllowStreamLocalForwarding no
AuthenticationMethods publickey
'';
};
endlessh = {
enable = true;
openFirewall = true;
port = 22;
extraOptions = [
"-6"
"-d 9000"
"-v"
];
};
}
}