How can I connect to the jupyter notebook by xshell with multiple hops?

526 Views Asked by At

I need two ssh to connect to the destination server.
ssh username1@ip_address1
ssh username2@ip_address2
How can I connect the second server from local (windows) with x-shell?

1

There are 1 best solutions below

0
On

If you are saying you need to connect to address_1 before you can then connect to address_2, in other words having address_1 act as a jump box, then you can configure your .ssh/config file to use address_1 as a proxy. E.g.

Host add_1_jump
 ForwardAgent yes
 Hostname ip_address1
 user username1

Host ssh ip_address2
 ProxyCommand ssh -W %h:%p add_1_jump

Then from your client machine when you do

ssh username2@ip_address2

It should pass the connection through address_1 for you.

For more info on this and using key files see articles such as

https://www.lorrin.org/blog/2014/01/10/one-liner-ssh-via-jump-box-using-proxycommand/