nix/module/common/Sshd.nix

36 lines
903 B
Nix
Raw Normal View History

{ ... }: {
2024-03-09 19:56:45 +03:00
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGIf192IxsksM6u8UY+eqpHopebgV+NNq2G03ssdXIgz root@desktop"
];
services.openssh = {
enable = true;
allowSFTP = true;
ports = [ 22143 ];
listenAddresses = [
{
addr = "0.0.0.0";
port = 22143;
}
];
2024-03-09 19:35:05 +03:00
settings = { # TODO: Migrate from passwords.
AllowUsers = [ "root" ];
LoginGraceTime = "1m";
2024-03-09 19:35:05 +03:00
MaxAuthTries = 4;
MaxSessions = 10;
2024-03-09 19:35:05 +03:00
PermitRootLogin = "yes"; # TODO: Make `prohibit-password`.
StrictModes = false;
UseDns = false;
UsePAM = true;
GSSAPIAuthentication = false;
HostbasedAuthentication = false;
KbdInteractiveAuthentication = true;
KerberosAuthentication = false;
PasswordAuthentication = true;
PermitEmptyPasswords = false;
2024-03-09 19:35:05 +03:00
PubkeyAuthentication = true;
};
};
}