I have the following topology:
- Linux server (Ubuntu 20.04) with static ip
- Windows server under NAT with no option to forward port to this machine
I need to access securely port of windows server from my linux server.
Currently I have plink.exe
wrapped into windows service with nssm
tool, configured as reverse proxy forwarding and in general it works - but in plink.exe
there seems to be no keep-alive settings and it's very unreliable, connection drops every day and I have to restart the service. There's also no way to customize service in nssm.exe
to have any kind of 'healthcheck' and restart logic.
I'm thinking about writing very simple tool on golang, which will observe the connection and restart it if it's lost, but it looks a bit hacky and maybe over-complicated, maybe I'm missing something and I wonder if there's simpler and more reliable way to achieve this kind of task?
Also I was thinking about installing msys2
on windows pc and try using openssh client instead of plink, but I'm not sure I will manage to wrap it as a service finally.