Skip to content

Using SSH in Visual Studio Code (VS Code) to Connect to HiPerGator

UFIT-RC no longer recommends the VS Code Remote-SSH Plugin

Use the VS Code Remote-Tunnels instead.

It is important to note that the SSH plug in connects you to one of the HiPerGator login servers. Users should be aware of the limits on running applications on the login servers.

If you want to run applications or scripts, use VSCode Remote Tunnels.

To remotely connect to HiPerGator using an SSH key with Visual Studio Code (VS Code), follow the steps below:

Step 1: Install the Remote Development extension

  1. Install the "Remote Development" extension in VS Code by visiting here.
  2. Reload VS Code if necessary after the installation is complete.

Step 2: Configure the SSH key

To configure the SSH key, complete the following steps:

  1. Open the VS Code command palette
    Windows: Ctrl + Shift + P
    macOS: ⌘ + Shift + P

  2. Launch the Remote‑SSH config editor
    Type Remote‑SSH: Open Configuration File… and press Enter.

  3. Choose the connection type (first time only)
    If VS Code asks, select SSH.

  4. Edit the SSH config file
    The command opens the file ssh_config (this is the same file as ~/.ssh/config).
    Scroll down to the section titled “Configure SSH on your local (client) computer.” and paste the single configuration block shown in the SSH‑keys guide.

  5. Save the file and close it.

Step 3: Connect to the remote server

Screenshot highlighting the VSCode SSH Connection Details button

To connect to HPG using VS Code, follow these steps:

  1. Open the VS Code command palette
    Windows: Ctrl + Shift + P
    macOS: ⌘ + Shift + P

  2. Type "Remote-SSH: Connect to Host..." and press Enter

  3. Select hpg from the list of hosts (the name you specified in the "Host" section of your ssh_config file).
  4. If this is the first time you're connecting to the server, you'll be prompted to confirm the server's fingerprint. Select Yes to continue.
  5. If prompted, enter your SSH key passphrase.
  6. You will need to select the Details button in the bottom right. This will let you authenticate with Duo using the terminal prompt.
  7. Wait for the connection to be established, and choose Linux as the operating system for the platform.
  8. Visual Studio Code will connect to the remote server via SSH and open a new window in which you can edit files and run commands on the server.

Note

There may be cases where you have to enter your passphrase more than once.

Step 4: Open a Remote Workspace

Once connected to the remote machine, you can open a remote workspace by clicking on the "Open Folder" button in the Remote Explorer panel and selecting a folder on the remote machine.

Step 5: Submit your jobs

While VSCode can be very convenient for viewing and editing files, the login node you are automatically connected to is not built for running jobs. Make sure you instead submit your jobs and connect to them.