added for vps

This commit is contained in:
alsaiduq-lab 2025-10-28 05:47:59 -06:00
parent 15d0cb574b
commit ffbf9e08f2
9 changed files with 314 additions and 21 deletions

28
hosts/server/security.nix Normal file
View file

@ -0,0 +1,28 @@
{
config,
pkgs,
...
}: {
services.openssh = {
enable = true;
ports = [8123];
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
};
users.users.root.openssh.authorizedKeys.keyFiles = [
../../.secrets/id_ed25519.pub
];
users.users.admin = {
isNormalUser = true;
extraGroups = ["wheel" "docker"];
openssh.authorizedKeys.keyFiles = [
../../.secrets/id_ed25519.pub
];
};
security.sudo.wheelNeedsPassword = false;
}