Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does vscode remote support double ssh?

I have a gpu-server Server-A in office. The only way to access that server is through the office wired network. The office provides a proxy server Server-B. How I connect to the Server-B? I first ssh login Server-B, then in the bash of Server-B, ssh login Server-A. I want to use vscode remote extension to work for Server-A. How can I do? I can connect to Server-B now in vscode.

like image 865
Qinsheng Zhang Avatar asked Sep 04 '19 01:09

Qinsheng Zhang


2 Answers

After several days of struggling, I have figured it out. As Marc said, vscode respects the tunnels I setup in my .ssh/config file. A sample can be like this:

Host serverA
HostName serverA_ip
PreferredAuthentications publickey
IdentityFile your_key
User you

Host serverB
Hostname serverB_ip
IdentityFile your_key
ProxyJump serverA
User you
like image 69
Qinsheng Zhang Avatar answered Oct 02 '22 08:10

Qinsheng Zhang


Have you looked into setting up a tunnel in your ssh config to go to Server-A via Server-B?I believe vscode will respect the tunnels you setup in your .ssh/config file.

like image 35
Marc Brooks Avatar answered Oct 02 '22 08:10

Marc Brooks