1 { pkgs, lib, config, hosts, ... }:
3 inherit (config.security) gnupg;
4 inherit (config.users) users;
7 systemd.services.ssh-mermet-reverse = {
8 after = [ "network-online.target" ];
9 wantedBy = [ "multi-user.target" ];
12 # Require services.openssh.gatewayPorts = "clientspecified";
14 ExecStart = ''${pkgs.openssh}/bin/ssh -v -g -N -T \
15 -o ServerAliveInterval=10 \
16 -o ExitOnForwardFailure=yes \
17 -R *:10022:localhost:22 \
18 ${hosts.mermet.extraArgs.ipv4}
24 boot.initrd.network.ssh = {
27 authorizedKeys = users.root.openssh.authorizedKeys.keys;
28 hostKeys = [ "/root/initrd/ssh.key" ];
35 services.upnpc.redirections =
37 { description = "SSH";
38 externalPort = 22; protocol = "TCP"; duration = 30 * 60;
39 service.wantedBy = ["sshd.service"];
40 service.partOf = ["sshd.service"];
42 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
43 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
44 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
45 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
47 { description = "SSH (boot)";
48 externalPort = 2222; protocol = "TCP"; duration = 0;
49 service.wantedBy = ["sshd.service"];