Is possible to ssh 2 times?

akari's profile image akari posted 5 years ago in General Permalink

I need to connect a db which the db need ssh 2 time to reach it. 125.xxx.xxx.xx -> 192.168.101.5 -> 192.168.101.2

current i using putty to tunnel/ssh port forwarding 125.xxx.xxx.xx -> 192.168.101.5 and connect 192.168.101.2 in heidisql.

ansgar's profile image ansgar posted 5 years ago Permalink

That should not be any problem using the SSH tunnel feature in HeidiSQL. You need to download plink.exe for that to work and tell HeidiSQL where it is.

Basic help for setting up SSH tunneled connection can be found on the help page.

akari's profile image akari posted 5 years ago Permalink

Sorry for the late reply, I know that we can use plink and set 1 time ssh in ssh tunnel tab. Is it possible that we ssh 2 times?

ansgar's profile image ansgar posted 5 years ago Permalink

No, you will need to create the first tunnel yourself in that case. HeidiSQL can just fire plink one time. I am not even sure you can use plink on both tunnels, or if you need putty.

akari's profile image akari posted 5 years ago Permalink

Yes, this current what I doing. Using putty tunnel 1st IP, then Plink do the 2nd one. Just wondering it is plink can do both tunnels, so that we no need to use the putty.

akari's profile image akari posted 5 years ago Permalink

I notice that Plink can do more than one tunnel in a single command line. D:\putty\plink.exe -ssh username1@125.25.2.15 -pw password -P 22 -i "D:\putty\key.ppk" ssh -tt root@192.168.1.12, it is Heidisql can set up plink command?

ansgar's profile image ansgar posted 5 years ago Permalink

No, such a two-server tunnel is not supported by HeidiSQL. You will have to run your tunnel manually, e.g. by Windows's integrated task planner at log on time.

Please login to leave a reply, or register at first.