I'm trying to create a ~/.ssh/config entry for the following scenario:
I have a linux box in a private network somewhere, a vps server which is accessible from anywhere and my local macbook.
The linux box is behind firewalls but I should still be able to SSH into the box from my local macbook.
My current solution which works is the following:
The linux box starts a reverse tunnel to the vps via:
ssh -R 15000:localhost:22 vps-user@vps
and then from my local macbook I start a tunnel to the vps via:
ssh -L 12345:localhost:1500 vps-user@vps
and then I start another ssh command from where I can directly ssh into the linux box which would else be hidden behind firewals etc.:
ssh linuxbox-user@localhost -p 12345
So first of all, this all works pretty reliably (if you have any easier way to do this, let me know - it seems pretty cumbersome on the macbook side).
How would I create a ~/.ssh/config entry to, in the best case scenario, just write:
and be done with it?
I've tried using the LocalForward option, which allows me to atleast make an alias for the ssh -L ... command but it still requires the second ssh command.
I've also tried the ProxyCommand option but to no luck, maybe just wrong configuration?