HPC via VS Code#
Using VS Code to connect to remote SSH machines is a significant quality of life improvement over direct SSH access via the terminal as it enables:
GUI based editing of files on the remote filesystem
Ability to manage multiple terminals without authenticating each one
These benefits do come with a slightly more involved setup process.
Install and be familiar with VS Code - if you are here we will assume you’ve already using VS Code.
Install the “Remote - SSH” extension from Microsoft. It should be the first option that appears if you search “ssh”
Have a correctly configured openssh configuration. This requires a C:\Users\your.name.ssh directory to exist and have the following two files
C:\Users\your.name.ssh\config - The openssh configuration file (see example below)
C:\Users\your.name.ssh\id_rsa - Your private ssh key - the public half of your key should already have been uploaded to lcrc accounts page.
Enable “Show Login Terminal” in the config (Ctrl+,). Search for this option (part of Extensions > Remote - SSH) and make sure that the “Always reveal the ssh login window” option is checked
With the above in place you can start a connection to a HPC cluster with
Open Command palette (Ctrl-Shift-P) and select “Remote-SSH Connect Current Window to Host” or “Remote-SSH Connect to Host”
Select the correct host from the drop down list (list is populated from your config file)
Confirm it is a “linux” host
When the terminal pops up a Duo request dialog, choose option 1 (type 1 and press enter)
After you are connected you can open a folder on the remote system (like your home directory or a checked out version of polaris-studio) and then edit files in that directory as if it was a local filesystem.
You can also launch multiple terminals (including split terminals) using the standard VS Code terminal interface without having to re-authenticate.
You can see which type of VS Code project you are currently operating in (local, “Remote - WSL”, or “Remote - SSH”) by checking the green connection icon in the very bottom left of the status bar. An example of each of the three types is shown below. This green section can also be clicked as a shortcut to bring up the “Remote” connection commands.

Example SSH Config#
An Example ssh config file which would live at c:\Users\your.user.ssh\config. Make sure to change your.user and id_rsa name (if non-standard).
# Enable hostname canonicalization for all connections
CanonicalizeHostname yes
CanonicalDomains lcrc.anl.gov
Host *
pubkeyacceptedkeytypes +rsa-sha2-256,rsa-sha2-512
# =================================
# Settings for all LCRC HPC systems
# =================================
Host *.lcrc.anl.gov
User your.user
IdentityFile ~/.ssh/id_rsa.lcrc
ForwardAgent true
MACs hmac-sha2-512
Host logins logins.lcrc.anl.gov
HostName logins.lcrc.anl.gov
Host bebop
HostName bebop.lcrc.anl.gov
ProxyJump logins.lcrc.anl.gov
Host crossover
HostName crossover.lcrc.anl.gov
ProxyJump logins.lcrc.anl.gov
Host improv
HostName ilogin1.lcrc.anl.gov
ProxyJump logins.lcrc.anl.gov
Host swing
HostName swing.lcrc.anl.gov
Example of Login dialog#
Below is what you should see in the terminal when your connection attempt is successfully attempting authentication with the login server. Type 1 and press enter to select the one and only option.
***********************************************************************************
* This machine accepts SSH public key + Duo MFA only. *
* If you do not have an SSH key and Duo set up, you will not be able to login. *
* *
* See https://docs.lcrc.anl.gov for more information. *
***********************************************************************************
(james.cook@ilogin1.lcrc.anl.gov) Duo two-factor login for james.cook
Enter a passcode or select one of the following options:
1. Duo Push to +XX XXX XXX 610
Passcode or option (1-1):
Exporting private key from Putty PPK#
If you have been using Putty previously you may only have a ppk rather than a standard public / private keypair. You can export an OpenSSH version by using puttygen.exe (should be in the same folder as your putty.exe):
Open PuttyGen
Click Load
Load your private key
Go to Conversions->Export OpenSSH and export your private key
Copy your private key to ~/.ssh/id_dsa.lcrc