1 { pkgs, lib, config, hosts, ... }:
5 settings.X11Forwarding = true;
7 systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
8 "host.key:${ssh/host.key.cred}"
15 boot.initrd.network.ssh = {
18 authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
19 hostKeys = [ "/root/initrd/ssh.key" ];
24 systemd.services.ssh-mermet-reverse = {
25 after = [ "network-online.target" ];
26 wantedBy = [ "multi-user.target" ];
29 # Require services.openssh.gatewayPorts = "clientspecified";
31 ExecStart = ''${pkgs.openssh}/bin/ssh -v -g -N -T \
32 -o ServerAliveInterval=10 \
33 -o ExitOnForwardFailure=yes \
34 -R *:10022:localhost:22 \
35 ${hosts.mermet._module.args.ipv4}
41 services.upnpc.enable = true;
42 services.upnpc.redirections =
49 service.wantedBy = [ "sshd.service" ];
50 service.partOf = [ "sshd.service" ];
52 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
53 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
54 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
55 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
58 description = "SSH (boot)";
62 service.wantedBy = [ "sshd.service" ];