init server modules

Former-commit-id: 98cf8e99b0
This commit is contained in:
Hadi
2025-03-18 23:09:42 +01:00
parent e26b4d0285
commit 16c9d54a30
4 changed files with 118 additions and 0 deletions

16
server-modules/ssh.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, ... }: {
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
openFirewall = true;
ports = [ 22 ];
settings.AllowUsers = [ config.var.username ];
};
users.users."${config.var.username}" = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPG9SE80ZyBcXZK/f5ypSKudaM5Jo3XtQikCnGo0jI5E hadi@nixy"
];
};
}