2023-05-17 17:10:18 +01:00
|
|
|
{...}: {
|
2023-05-16 11:48:34 +01:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2023-05-25 17:05:25 +01:00
|
|
|
ports = [22];
|
2023-05-16 11:48:34 +01:00
|
|
|
settings = {
|
|
|
|
UseDns = true;
|
2023-05-16 12:06:28 +01:00
|
|
|
PermitRootLogin = "no";
|
2023-05-16 11:48:34 +01:00
|
|
|
PasswordAuthentication = false;
|
|
|
|
GatewayPorts = "yes";
|
|
|
|
LogLevel = "VERBOSE";
|
|
|
|
};
|
|
|
|
};
|
2023-05-25 17:05:25 +01:00
|
|
|
services.traefik.dynamicConfigOptions.tcp = {
|
|
|
|
routers.ssh = {
|
|
|
|
rule = "ClientIP(`192.168.0.0/16`)";
|
|
|
|
entryPoints = ["ssh"];
|
|
|
|
service = "ssh-redirect";
|
|
|
|
};
|
|
|
|
services.ssh-redirect.loadBalancer.servers = [{address = "localhost:22";}];
|
|
|
|
};
|
2023-05-16 11:48:34 +01:00
|
|
|
}
|