dotfiles/modules/server/ssh.nix
2026-03-18 22:55:04 +02:00

20 lines
467 B
Nix

{config, ...}: {
flake.modules.nixos.server = {
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
};
networking.firewall.allowedTCPPorts = [22];
networking.firewall.allowedUDPPorts = [22];
users.users.${config.flake.meta.user.name} = {
openssh.authorizedKeys.keys = [
config.flake.meta.user.ssh_key
];
};
};
}