VScode with SSH client | CS 2113 Software Engineering - Fall 2021

Running VSCode with SSH via shell01.seas.gwu.edu

Having trouble with the docker on your local machine, you can use this guide to instead develop using ssh connection to shell01.seas.gwu.edu (the SEAS linux server).

  1. Install Visual Studio Code (VS Code)
    https://code.visualstudio.com/download

  2. Install the Remote - SSH Extension

  3. Install SSH on your local computer
    • Ubuntu/Debian : Comes pre-installed but if it doesn’t
      sudo apt-get install openssh-client
      
    • MacOS : Comes pre-installed
    • Windows : Install Git for Windows comes with an ssh clien
  4. Connect to the GW VPN
    – See this guide from GW IT for more details

    You must be connect to the GW VPN to ssh into shell0

  5. Open a new VSCode Window
    – Open the command pallet with F1 key
    – Type Remote-SSH: Connect to host
    – Then enter gwusername@shell01.seas.gwu.edu where gwusername is your NetID for GW. Like in your email gwusername@gwu.edu
    – Hit enter, and you may be prompted for a password, enter your GW account password
    – Once your connected you should see a green bar at the bottom left saying something like SSH shell01.seas.gwu.edu.

  6. Continue with this guide for using vscode and git to complete your assignment

    If you’re asked to open a docker container, say no. It should work as is.

  7. OR, open a folder from the explorer (this can be your home folder)
    – Then continue with the vscode guide at step 8

Extra stuff

Setting up an SSH key on shell01 with github

Note you only need to do this once

  1. Once your connected to shell01 via instructions above open an integrated terminal
    – Open the command pallet with F1 key
    – Type/select Terminal: Create New Integrated Terminal

  2. Generate a ssh-key use ssh-keygen
    – In the terminal type
       ssh-keygen
    

    – Hit enter to each of the questions
    – No, you do not need a passphrase

  3. Copy your public key
    – In the terminal type
       cat .ssh/id_rsa.pub
    

    – This will print out your public key, select and copy it from thee terminal
    – Make sure you copy the whole thing beginning with ssh-rsa ending with something like username@shell01

  4. Go to github.com and add your SSH key
    – make sure you’re logged in
    – select your icon in the upper right
    – select settings
    – select SSH and GPG Keys from the options
    – click the green button New SSH key
    – Paste your ssh-key you copied from above in there and hit enter

  5. Once you do that, you shouldn’t need a password to push/pull your repos

Setting up your git profile on shell01

You only need to do this once

  1. Once your connected to shell01 via instructions above open an integrated terminal
    – Open the command pallet with F1 key
    – Type/select Terminal: Create New Integrated Terminal

  2. In the terminal run the following commands

    git config --global user.name "John Doe"
    git config --global user.email johndoe@example.com
    

    Where John Doe is replaced with your name and johndoe@example.com is replaced with the email address you used to sign up to github

Retrieving files from shell01 to your local machine

Note that when you work on shell01 all the files are stored remotely. This is no big deal since you can always push your changes for this class to github, but you may want to also store a local copy.

  1. Once your connected to shell01 via instructions above open an integrated terminal
    – Open the command pallet with F1 key
    – Type/select Terminal: Create New Integrated Terminal

  2. Select the explorer tab on VSCode on the right
    – Open folder
    – Select the folder you wish to load into VSCode (this can be your home folder)

  3. Navigate to the file you want in the explorer within VSCode.

  4. Select the file and DRAG it to your local machine desktop or another folder from your file explorer.