nix/module/common/Sshd.nix

34 lines
796 B
Nix
Raw Normal View History

{ secret, ... }: {
users.users.root.openssh.authorizedKeys.keys = secret.ssh.trustedKeys;
services.openssh = {
enable = true;
allowSFTP = true;
ports = [ 22143 ];
listenAddresses = [
{
addr = "0.0.0.0";
port = 22143;
}
];
2024-03-09 20:13:06 +03:00
settings = {
2024-04-14 06:44:00 +03:00
AllowUsers = [ "root" "nixbuilder" ];
LoginGraceTime = "1m";
2024-04-09 16:48:57 +03:00
# MaxAuthTries = 1;
MaxSessions = 10;
2024-03-09 20:13:06 +03:00
PermitRootLogin = "prohibit-password";
StrictModes = false;
UseDns = false;
UsePAM = true;
GSSAPIAuthentication = false;
HostbasedAuthentication = false;
2024-03-09 20:13:06 +03:00
KbdInteractiveAuthentication = false;
KerberosAuthentication = false;
2024-03-09 20:13:06 +03:00
PasswordAuthentication = false;
PermitEmptyPasswords = false;
2024-03-09 19:35:05 +03:00
PubkeyAuthentication = true;
};
};
}