Search code examples
sshvisual-studio-codevscode-remote

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-A? 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.


Solution

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

    Host serverB
    HostName serverB_ip
    PreferredAuthentications publickey
    IdentityFile your_key
    User you
    
    Host serverA
    Hostname serverA_ip
    IdentityFile your_key
    ProxyJump serverB
    User you