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

Scott Ferguson scott.ferguson.clug at gmail.com
Sun Jan 18 21:45:46 MST 2015


On 19/01/15 15:15, Hal Ashburner wrote:
> 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.


It's not relevant (just a convenient persistent connection wrapper for
ssh), the equivalent below is correct.

> 
> 
>>
>> 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.


I probably should have mentioned earlier that the reverse ssh uses a key
only recognized by gateway_box, and an account on it without a login to
create the tunnel.

> 
> 
> Give it at try as written substituting the relevant hostnames and see
> how you go? Should take you about 3 minutes to test.

Will do as soon as I get a chance (might be a couple of days) - I'll
post the results.


> Don't forget the -v switch to ssh if you have troubles.
> 
> All the best.
> Hal
> 
> 
> 
<snipped>

Thanks for your time





More information about the linux mailing list