Set PermitRootLogin as a default value

This commit is contained in:
Chris Toph 2025-01-17 01:18:08 -05:00
parent 0a2c3d46e0
commit fb2f410e89

View file

@ -1,17 +1,21 @@
{ {
programs.ssh.startAgent = true; lib,
...
}:
{
programs.ssh.startAgent = true;
users.users.root.openssh.authorizedKeys.keys = [ users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIClZstYoT64zHnGfE7LMYNiQPN5/gmCt382lC+Ji8lrH PVE" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIClZstYoT64zHnGfE7LMYNiQPN5/gmCt382lC+Ji8lrH PVE"
]; ];
services.openssh = { services.openssh = {
enable = true; enable = true;
settings = { settings = {
AllowUsers = null; # everyone AllowUsers = null; # everyone
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
PermitRootLogin = "no"; PermitRootLogin = lib.mkDefault "no";
};
}; };
};
} }