Skip to content

VS Code (Windows)#

SSH Key generation#

Use the command line to generate an ssh key or generate the SSH key in Windows PowerShell. The public and private keys are stored in C:/Users/<username>/.ssh.

VS Code SSH pass-through setup#

Please refer to VS code's own documentation about Remote Development using SSH and their SSH Tutorial.

  • Install the "Remote SSH" extension in VS Code.
  • On the bottom left corner, in blue color the symbol "><" will be there. When hovering, it will say "Open a Remote Window"
  • Click on it, select "Connect to Host..." and then "Add New SSH Host".
  • Give the username and cluster id. E.g. <HPC account>@<clustername>.nhr.fau.de, press Enter and VS Code will prompt you to select the .config file to add the host.
  • Select the standard .config file on your computer C:/Users/<username>/.ssh/config from the drop down prompt and click on "Open Config" in the little window appearing in the bottom right corner indicating the host was added.
  • Now adjust the private key location (IdentityFile) and other options as shown in the template config files
  • Save and close the config file and click the blue Remote symbol ("><") in the bottom left again and select "Connect to Host..." and one of your newly added host names.
  • If you are using this for the first time, you might get asked to choose the operating system. E.g. Linux.
  • Then you will be asked for your private key passphrase.
  • The "><" symbol should now show "SSH: <cluster name>"

Proxy Jumps

If you configured a proxy jump in your SSH config, VS Code will not invoke a login shell by default. To change this, follow these steps:

  • Open the settings by pressing Ctrl+, and search for "terminal.integrated.profiles.linux", then click "Edit in settings.json".
  • Adjust the entry for bash so it contains:
    "bash": {
        "path": "bash",
        "icon": "terminal-bash",
        "args": [ "-l" ],
    },
    
  • Save and close the settings.json file
  • Open a new Terminal by clicking "Terminal" and "New Terminal", then click on the "+" symbol in the newly opened Terminal area and click on "Select Default Profile"
  • Choose the "bash bash -l" profile in the drop down prompt, close the current terminal (trash bin symbol 🗑), and open a new terminal that now uses a login shell.