Files
nix-config/hosts/server-gpu/ssh.nix

20 lines
406 B
Nix

{
config,
pkgs,
...
}: {
services.openssh.enable = true;
# Disable password login for security
services.openssh.settings.PasswordAuthentication = false;
services.openssh.settings.PermitRootLogin = "no";
# Add your authorized key for a specific user
users.users.yourusername = {
isNormalUser = true;
openssh.authorizedKeys.keys = [
config.age.secrets.ssh-pub
];
};
}