Using VS Code with SSH ENSL

This page explains how to download Visual Studio Code, install the extension needed for remote work, and then connect to a CBP machine through the ENS de Lyon SSH server.

1. Download and install VS Code

  1. Go to the official website: https://code.visualstudio.com/.
  2. Download the version adapted to your operating system: Windows, macOS, or Linux.
  3. Run the installer and keep the default options.
VS Code is free. It allows you to edit files and open a folder located on a remote machine directly.

2. Install the Remote - SSH extension

  1. Open VS Code.
  2. Click the Extensions icon in the left sidebar (4 small squares).
  3. Search for Remote - SSH.
  4. Install the extension published by Microsoft.

This extension allows VS Code to open a working session directly on a remote machine via SSH.

3. Configure the SSH file

VS Code uses your local SSH configuration. You therefore need to fill in the OpenSSH config file.

On Linux or macOS The file is generally located at
/Users/YourName/.ssh/config.
On Windows The file is often located at C:\Users\YourName\.ssh\config.

Alternatively,
  1. Click the Remote explorer icon in the left sidebar (computer screen icon).
  2. Click on the gear icon to the right of SSH.

Then, fill the file. The content may look like this if you use anchiale10:

Host ens-lyon
  HostName ssh.ens-lyon.fr
  User username

Host anchiale10
  HostName anchiale10.cbp.ens-lyon.fr
  User username
  ProxyJump ens-lyon

Here, ens-lyon refers to the ENS SSH gateway, and anchiale10 is the final machine to reach. The line ProxyJump ens-lyon means that the connection first goes through ssh.ens-lyon.fr.

Adapt the remote machine name accordingly. The full list and availabilities is https://www.cbp.ens-lyon.fr/python/forms/CloudCBP. .

4. Connect from VS Code

  1. Click the Remote explorer icon in the left sidebar (computer screen icon).
  2. Click on the arrow associated with the machine you want to use.
  3. You are connected.

5. Open a remote folder

Once connected, you can open a folder located on the remote machine with File > Open Folder. You then work directly on the server files without needing to copy them locally.