nixos/modules/base/ssh.nix

21 lines
493 B
Nix
Raw Normal View History

2023-08-01 15:35:09 +02:00
{ ... }: {
services.openssh = {
enable = true;
2023-08-25 00:57:42 +02:00
# Security by obscurity? Nah, but it certainly reduces the logs volume.
# Also, port 222 still requires root to bind.
2023-08-01 15:35:09 +02:00
ports = [ 222 ];
settings = {
PasswordAuthentication = false;
};
};
environment.persistence."/nix/persist" = {
2023-08-01 16:55:53 +02:00
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
2023-08-01 15:35:09 +02:00
};
}