1 { pkgs, lib, config, hosts, ... }:
3 inherit (config.security) gnupg;
4 inherit (config.users) users;
7 /* Wireguard is used instead
8 systemd.services.ssh-mermet-reverse = {
9 after = [ "network-online.target" ];
10 wantedBy = [ "multi-user.target" ];
13 # Require services.openssh.gatewayPorts = "clientspecified";
15 ExecStart = ''${pkgs.openssh}/bin/ssh -v -g -N -T \
16 -o ServerAliveInterval=10 \
17 -o ExitOnForwardFailure=yes \
18 -R *:10022:localhost:22 \
19 ${hosts.mermet.extraArgs.ipv4}
26 boot.initrd.network.ssh = {
29 authorizedKeys = users.root.openssh.authorizedKeys.keys;
30 hostKeys = [ "/root/initrd/ssh.key" ];
42 services.upnpc.redirections =
44 { description = "SSH";
45 externalPort = 22; protocol = "TCP"; duration = 30 * 60;
46 service.wantedBy = ["sshd.service"];
47 service.partOf = ["sshd.service"];
49 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
50 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
51 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
52 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = ["sshd.service"]; }
54 { description = "SSH (boot)";
55 externalPort = 2222; protocol = "TCP"; duration = 0;
56 service.wantedBy = ["sshd.service"];