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.enable = true;
38 services.upnpc.redirections =
45 service.wantedBy = [ "sshd.service" ];
46 service.partOf = [ "sshd.service" ];
48 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
49 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
50 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
51 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
54 description = "SSH (boot)";
58 service.wantedBy = [ "sshd.service" ];