nix/module/common/Sshd.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

{ ... }: {
2024-03-09 19:56:45 +03:00
users.users.root.openssh.authorizedKeys.keys = [
2024-03-17 01:22:54 +03:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuuw5ek5wGB9KdBhCTxjV+CBpPU6RIOynHkFYC4dau3 root@dasha"
2024-03-09 19:56:45 +03:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGIf192IxsksM6u8UY+eqpHopebgV+NNq2G03ssdXIgz root@desktop"
2024-03-09 20:01:26 +03:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSWdbkYsRiDlKu8iT/k+JN4KY08iX9qh4VyqxlpEZcE root@home"
2024-03-09 20:13:06 +03:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFgiYKFkMfiGOZCZIk+O7LtaoF6A3cHEFCqaPwXOM4rR root@work"
2024-03-09 20:10:51 +03:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIL2LI1iFDZC223aWqBVz9yusfB/XrRwsBKiL5warIF/ nix-on-droid@phone"
2024-03-09 19:56:45 +03:00
];
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 = {
AllowUsers = [ "root" ];
LoginGraceTime = "1m";
2024-03-09 20:13:06 +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;
};
};
}