feat: refactor the modules/servers directory.
This commit is contained in:
parent
4e783c052b
commit
8b754d3a7e
69 changed files with 61 additions and 62 deletions
32
modules/servers/common/openssh.nix
Normal file
32
modules/servers/common/openssh.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
AllowUsers =
|
||||
lib.mkIf (config.networking.hostName != "tyr")
|
||||
[
|
||||
"root@65.21.241.194"
|
||||
"root@172.16.0.2"
|
||||
"crony@65.21.241.194"
|
||||
"crony@172.16.0.2"
|
||||
];
|
||||
X11Forwarding = false;
|
||||
PasswordAuthentication = false;
|
||||
};
|
||||
extraConfig = ''
|
||||
PubkeyAuthentication yes
|
||||
PermitEmptyPasswords no
|
||||
|
||||
AddressFamily inet
|
||||
MaxAuthTries 3
|
||||
'';
|
||||
};
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJLduAXHWJiglmfRfkBGKffzVWkJP6porxIzw6+Zz3W crony@cronyakatsuki.xyz"
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue