2024-11-17 10:28:43 +05:30
|
|
|
{ config, ... }:
|
|
|
|
let facts = config.nodeconfig.facts; in {
|
|
|
|
networking.firewall.interfaces.ens3.allowedTCPPorts = [ 22 ];
|
2024-11-09 20:27:33 +05:30
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2024-11-17 10:28:43 +05:30
|
|
|
openFirewall = false;
|
|
|
|
listenAddresses = [
|
|
|
|
{ addr = facts.wireguard-ip; port = 22; }
|
|
|
|
{ addr = facts.local-ip; port = 22; }
|
|
|
|
];
|
2024-11-09 20:27:33 +05:30
|
|
|
settings = {
|
|
|
|
KbdInteractiveAuthentication = false;
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
};
|
|
|
|
hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/persist/secrets/ssh/keys/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/persist/secrets/ssh/keys/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = "4096";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|