Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to SSH into a remote from another remote using VScode?

My workflow is: I ssh into machine A from my local, then into machine B from machine A. I wish to develop on machine B using VScode remote functionality but this two-level ssh doesn't look straight forward in VScode and a google search didn't yield much info on it either.

Is there a way to do this?

Thanks!

like image 364
kanishk Avatar asked Oct 15 '25 08:10

kanishk


1 Answers

The key word is ProxyJump here.

ssh hostb -o ProxyJump=hosta

For using it with vscode, you should edit your .ssh/config

HOST my_alias_name_for_host_a
  hostname ip_or_hostname
  user my_username_on_host_a

HOST my_alias_name_for_host_b
  hostname ip_or_hostname
  user my_username_on_host_b
  ProxyJump my_alias_name_for_host_a

vscode will work without even knowing that there is an intermediate host

like image 147
jeb Avatar answered Oct 18 '25 08:10

jeb