From dba987be154ce4533e58fdb6872353abe40f611b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 17 Sep 2022 19:41:19 +0800 Subject: [PATCH] aux: ssh reverse proxy https://spoton.cz/index.php/2017/12/04/reverse-ssh-proxy-with-systemd/ --- aux-etc-nixos/configuration.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aux-etc-nixos/configuration.nix b/aux-etc-nixos/configuration.nix index 30a96a4..eb93ccf 100644 --- a/aux-etc-nixos/configuration.nix +++ b/aux-etc-nixos/configuration.nix @@ -127,6 +127,19 @@ in shell = pkgs.fish; }; + systemd.services.ssh-reverse-proxy = { + description = "SSH Reverse Proxy"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + Restart = "always"; + RestartSec = "1min"; + User = "backupdl"; + Group = "users"; + ExecStart = "${pkgs.openssh}/bin/ssh -R 42.200.147.171:3940:localhost:22 -o ServerAliveInterval=60 -o ServerAliveCountMax=1 -o ExitOnForwardFailure=yes -N -T nixbld.m-labs.hk"; + }; + }; + documentation.enable = false; environment.systemPackages = with pkgs; [ wget vim git usbutils pciutils file lm_sensors acpi