Suppose we have three hosts:
miki
- my computer behind a NATvps0
- my VPSmum
- computer of my mother, behind a different NAT.
The task is to connect from my computer to my mum and keep X11 forwarding. Until now I used reverse tunneling like below:
# on mum's computer (at crontab on reboot):
autossh -fN -M 3986 -R 1993:localhost:22 login@vps0
# when I want to connect to mum's computer
miki$ ssh login@vps0
vps0$ ssh localhost -p 1993
Presented above approach, has a disadvantage that I can't use X11 forwarding (-X parameter) - I can't open windows remotely.
I am wondering if is it possible to connect directly to my mum's computer and keep X11 forwarding.
PS. I sow answers in topic: SSH tunnel through middleman server - how to connect in one step (using key pair)?. Unfortunately using that solutions causes that X11 forwarding doesn't work.
ProxyCommand
andForwardX11
to connect remote hosts behind router and invoke X11 apps there. Simple chain ofssh -X
should also work, OP can dossh -X login@vps0
followed byssh -X localhost -p 1993
and have correct$DISPLAY
on mum's computer. – yaegashi Aug 18 '15 at 17:28