Split sshd module.

This commit is contained in:
2023-06-30 10:21:31 +01:00
parent 2057ebd6c9
commit 27bb3fe3ba
2 changed files with 24 additions and 22 deletions

23
hosts/common/sshd.nix Normal file
View File

@@ -0,0 +1,23 @@
{
services.openssh = {
enable = true;
allowSFTP = false;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
extraConfig = ''
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
AllowStreamLocalForwarding no
AuthenticationMethods publickey
'';
};
networking.firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
allowedUDPPorts = [ ];
};
}