This question already has an answer here:
I have an mysql Server on hostD. I can access hostD through hostC, hostC through hostB, hostB through hostA and I access hostA using putty on my home device
My goal is to access the server from my home device.
Another challenge is that I don't have any root access on A,B and C. Now I've been experimenting with the '.ssh/config' file and this is what I got so far:
Host BTunnel HostName hostB LocalForward 3306 localhost:3306 Host CTunnel HostName hostC LocalForward 3306 localhost:3306 Host DTunnel HostName hostD LocalForward 3306 localhost:3306
This way I can connect from Putty--> hostA and type in consecutively:
ssh BTunnel ssh CTunnel ssh DTunnel
To get a tunnel from A to D. But I would like to have a solution, where I only type in 1 command from host A to get a Tunnel to D, maybe by chaining up the existing host aliases.
Can anyone offer a solution?