[clug] X-Forwarding between two boxes via a third using reverse ssh problem

Hal Ashburner hal at ashburner.info
Sun Jan 18 21:15:11 MST 2015

On 19 January 2015 at 15:10, Scott Ferguson
<scott.ferguson.clug at gmail.com> wrote:
> On 19/01/15 14:08, Hal Ashburner wrote:
>> remote box
>> $ ssh -X -R  8888:localhost:22 my_laptop
>> note that there is an .ssh/config that has a proxycommand
> Bingo!  Many thanks - I overlooked that option. It looks like the likely
> solution.
> I'm (more than?) a little confused though.
> The setup I use is:-
> remote box
> autossh -M 10984 -o PubkeyAuthentication=yes -o
> PasswordAuthentication=no -i .ssh/nopwd -X -R 6666:localhost:22
> remote at gateway_box -p 222

Lost me here, I don't know anything about autossh and don't have time
just now to change that fact.

> which is the equivalent(?) of:-
> ssh -R 6666:localhost:22 gateway_box
> So if I added to ~/.ssh/config on my, local box:-
> Host remote_laptop
>         proxycommand ssh -W %h:%p gateway_box
> I don't see how the connection would work.... or did you mean
> gateway_box instead of my_laptop in the first remote box example?

No, no correction. That is actually what I "did"
Those are the actual commands I tested for you with the actual results.

At no stage did I ever touch the gateway box or directly ssh to it.

Give it at try as written substituting the relevant hostnames and see
how you go? Should take you about 3 minutes to test.
Don't forget the -v switch to ssh if you have troubles.

All the best.

> Current setup:-
> remote = remote_box (mobile connection somewhere in NT)
> middle = gateway_box (static connection in Sydney)
> local = mobile_laptop (mobile connection in the ACT)
> remote creates reverse ssh tunnel to middle (preferably with X Forwarding)
> local connects to middle, and from there to remote via localhost:6666
>> through a
>> gateway to get to my_laptop, the gateway is headless, the possibly
>> relevant part of the config is below.
>> --------
>> Host my_laptop
>>     user hal
>>     proxycommand ssh -W %h:%p gateway_box
>> -------
>> then on my_laptop
>> $ ssh -X localhost -p 8888
> That makes sense, but I'm confused because in my case remote box has no
> way of knowing the IP address of my_laptop (it's a DHCP internet
> connection usually).
>> on the resulting prompt from the last command
>> [ remote_box ]$ xeyes
>> seemed to work in getting xeyes up on my local screen.
>> Can you do something like that?
> I'd certainly like to, and will try this evening if the remote user can
> get a signal.
> I hope that if I can get X Forwarding working simply, then I can use the
> same config (without the -X) to enable X2Go so they can share the
> desktop for help with application use.
>> On 19 January 2015 at 13:12, Scott Ferguson
>> <scott.ferguson.clug at gmail.com> wrote:
>>> I need to support some GUI apps on a remote laptop connected to the
>>> internet using a USB connection to an Android phone, and/or public wifi
>>> hotspots (so port-forwarding on an ADSL modem is not a solution).
>>> Connections are routinely very slow as the user is usually in remote
>>> locations.
> <snipped>
> Kind regards
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux

More information about the linux mailing list