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

View File

@@ -2,6 +2,7 @@
{
imports = [
./impermanence.nix
./sshd.nix
./user-ppetru.nix
];
@@ -31,28 +32,6 @@
vim
];
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 = [ ];
};
system.copySystemConfiguration = false; # not supported with flakes
# This value determines the NixOS release from which the default

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 = [ ];
};
}