Ungraded Assignment 4: Local VS Code installation

Week 9 (deadline: Monday Oct 27 at noon)

Author
Affiliation

Jelmer Poelstra

Published

October 17, 2025



1 Overview

So far, you’ve been connecting to OSC through the OnDemand webportal. However, there is another more basic and universal method to connect to remote computers: SSH, which is short for Secure Shell. An optional self-study page on SSH shows you how to directly use the ssh command in a terminal on your own computer to “move” to OSC within that terminal.

Here, on the other hand, you’ll do some setup that allows you to connect a VS Code installation on your computer to OSC using a process called “SSH-tunneling”. Being able to use your own VS Code installation at OSC has several advantages over using VS Code Server through OnDemand, such as:

  1. You won’t have to start a VS Code Server job every time
  2. Your connection will not have a time limit unlike VS Code Server jobs
  3. You can use VS Code “proper” rather than the Server version which has slightly reduced functionality1 – for example, you can use integrated generative AI with GitHub Copilot this way
Make sure to have this set up before next week’s class!

Please complete this assignment by noon on Monday, October 27th. If you struggle, you can come to Monday’s recitation session to troubleshoot. If you can’t make that session, please contact us on or before Monday so we can find anoteyr way to troubleshoot this. We will start using this functionality in class on Tuesday, October 28th.

2 Set up your local VS Code to SSH tunnel into OSC

2.1 Setting up the connection

  1. Install VS Code on your own computer:

    • “Regular” installation instructions for Windows / Mac / Linux

    • If you are using an OSU computer, you may not have the required “administrative privileges” to install software on your computer the regular way. However, you should in that case have an OSU application on your computer that allows you to install a selection of approved software, and that selection should include VS Code. On Windows, this app seems to be simply called “Software Center”, whereas on Mac, it is called “Ohio State Application Self Service” (names likely vary).

  2. Open VS Code and install the “Remote Development extension pack”: open the Extensions side bar and search for it there. Once you found it, click on its Install button like you’ve done previously with other extensions.

  3. Open the VS Code Command Palette (e.g. with F1 or Ctrl+Shift+P) and start typing “Remote SSH”:

    • Among the options that pop up, select “Remote-SSH: Add New SSH Host…” and specify your SSH connection: ssh <osc-username>@pitzer.osc.edu, e.g. ssh jelmer@pitzer.osc.edu 2

    • In the “Select SSH configuration file to update” dialog that should pop up, just select the first (top) option that shows up

  4. You’ll get a “Host Added!” pop-up in the bottom-right of your screen: in that pop-up, click “Connect”, and:

    • When you get a message like that shown below, click “Continue”:

      “pitzer.osc.edu” has fingerprint <…>
      Are you sure you want to continue?

    • Enter your password when you’re prompted for it

    • If you’re asked about the operating system of the host, select Linux

  5. Now, you’re connected, and VS Code may give you some more pop-ups:

    • If you’re asked whether you “Trust the Authors” of such-and-such directory, click “Yes”.
    • If there is a pop-up in the bottom-right asking you to update Git, click “No” and check “Don’t show again”.

2.2 Connecting from now on

With the above one-time setup done, connecting to OSC with your local VS Code installation will be quick:

  1. Open the VS Code Command Palette (e.g. with F1 or Ctrl+Shift+P) and start typing “SSH Connect

  2. Click on “SSH: Connect to Host” and then select your Pitzer connection

  3. Enter your password (but this won’t be necessary anymore after you do the below setup!)

  4. Like you’ve seen with VS Code Server, the program’s default location is your Home dir, and it is best to change this using the “File” > “Open Folder” option: go to your /fs/ess/PAS2880/users/$USER dir.

2.3 Connecting from now on to previously opened folders

Conveniently, VS Code will remember folders that you’ve opened this way, and show them on the “Welcome” tab that is always displayed when you open the program. Test this:

  1. Completely quit VS Code
  2. Open it again, and under “Recents” on the Welcome tab, look for your folder in /fs/ess/PAS2880/, and click on that to connect to OSC and open that folder!
You are now on a login node!

Just be aware that you’ll now be on a Login node (and not on a Compute node like when you use VS Code through OnDemand), so avoid running analyses directly in the terminal, and so on.

3 Avoid being prompted for your OSC password

If you take the following steps, you will no longer be prompted for your OSC password every time you connect to OSC with the above method (or with any other SSH-based method).

  1. On your own computer, open a terminal application.

    • On a Mac, you should have an app called “Terminal” and potentially other options like “iTerm”: any of these fill work
    • On Windows 11+, this should be called the “Windows Terminal”
  2. Generate a public-private SSH key-pair:

    ssh-keygen -t rsa

    You’ll get some output and will then be asked several questions, but in each case, you can just press Enter to select the default answer.

  3. Transfer the public key to OSC’s Pitzer cluster:

    cat ~/.ssh/id_rsa.pub | ssh <user>@pitzer.osc.edu 'mkdir -p .ssh && cat >> .ssh/authorized_keys'
    # Replace <user> by your username, e.g. "ssh-copy-id jelmer@pitzer.osc.edu"
    ssh-copy-id <user>@pitzer.osc.edu
  4. All done! Test if it works by connecting


The same commands work for Cardinal, just replace pitzer with cardinal in the commands above


Back to top

Footnotes

  1. especially the older versions that are installed at OSC↩︎

  2. You’ll have to do this separately for Cardinal if you want to be able to connect to both clusters this way.↩︎