1 { pkgs, lib, config, hosts, ... }:
3 systemd.services.ssh-mermet-reverse = {
4 after = [ "network-online.target" ];
5 wantedBy = [ "multi-user.target" ];
8 # Require services.openssh.gatewayPorts = "clientspecified";
10 ExecStart = ''${pkgs.openssh}/bin/ssh -v -g -N -T \
11 -o ServerAliveInterval=10 \
12 -o ExitOnForwardFailure=yes \
13 -R *:10022:localhost:22 \
14 ${hosts.mermet._module.args.ipv4}
20 boot.initrd.network.ssh = {
23 authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
24 hostKeys = [ "/root/initrd/ssh.key" ];
37 services.upnpc.redirections =
39 { description = "SSH";
40 externalPort = 22; protocol = "TCP"; duration = 30 * 60;
41 service.wantedBy = ["sshd.service"];
42 service.partOf = ["sshd.service"];
44 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
45 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
46 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
47 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
49 { description = "SSH (boot)";
50 externalPort = 2222; protocol = "TCP"; duration = 0;
51 service.wantedBy = ["sshd.service"];