nixos-config/.my_old_dotfiles/system/security/sshd.nix
2024-07-17 16:50:35 +02:00

16 lines
323 B
Nix

{ userSettings, authorizedKeys ? [], ... }:
{
# Enable incoming ssh
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
users.users.${userSettings.username}.openssh.authorizedKeys.keys = authorizedKeys;
}