Hi,
how can I configure following scenario or is it even possible.
I have server x and y. I can access to server y only via server x.
I have HeidiSQL and plink.exe to use
Double tunneling using HeidiSQL
AFAIK this can not be done directly. You could use
plink.exe -L 3307:host1:3307 -m cmds.sh -pw passwd1 user1@host1
where the file cmds.sh contains the single command
ssh -N -L 3307:host2:3306 user2@host2
to set up the secondary tunnel to host2.
however, this can not be automatically called from heidisql since it gives no means to modify the generated plink.exe call; you have to call this by hand before opening the appropriate session (which should NOT specify type "SSH tunnel", but just use type "MySQL (TCP/IP)" with host =localhost and port =3307).
also, the second password must be input by hand, since ssh does not have an equivalent of the -pw switch. you could also use publickey auth on the secondary host if posssible, this would then use the -i keyfile switch with ssh.
plink.exe -L 3307:host1:3307 -m cmds.sh -pw passwd1 user1@host1
where the file cmds.sh contains the single command
ssh -N -L 3307:host2:3306 user2@host2
to set up the secondary tunnel to host2.
however, this can not be automatically called from heidisql since it gives no means to modify the generated plink.exe call; you have to call this by hand before opening the appropriate session (which should NOT specify type "SSH tunnel", but just use type "MySQL (TCP/IP)" with host =localhost and port =3307).
also, the second password must be input by hand, since ssh does not have an equivalent of the -pw switch. you could also use publickey auth on the secondary host if posssible, this would then use the -i keyfile switch with ssh.
ok, got this finally working. cmds.sh should contain following: "ssh -fNg -L 3307:127.0.0.1:3306 user@host2"
I have the ssh key between host1 host2
And I have edited plink.exe shortcut parameters:
"C:\Users\xxx\Desktop\xxx\ssh key\plink.exe" -L 3307:host1:3307 -pw passwor user@host1 bash -x "/user/cmds.sh"
hope this helps also others.
I have the ssh key between host1 host2
And I have edited plink.exe shortcut parameters:
"C:\Users\xxx\Desktop\xxx\ssh key\plink.exe" -L 3307:host1:3307 -pw passwor user@host1 bash -x "/user/cmds.sh"
hope this helps also others.
Please login to leave a reply, or register at first.