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 toshell01.seas.gwu.edu
(the SEAS linux server).
-
Install Visual Studio Code (VS Code)
https://code.visualstudio.com/download -
Install the Remote - SSH Extension
- 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
- Ubuntu/Debian : Comes pre-installed but if it doesn’t
- Connect to the GW VPN
– See this guide from GW IT for more detailsYou must be connect to the GW VPN to ssh into
shell0
-
Open a new VSCode Window
– Open the command pallet with F1 key
– TypeRemote-SSH: Connect to host
– Then entergwusername@shell01.seas.gwu.edu
wheregwusername
is your NetID for GW. Like in your emailgwusername@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 likeSSH shell01.seas.gwu.edu.
- 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.
- 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
-
Once your connected to
shell01
via instructions above open an integrated terminal
– Open the command pallet with F1 key
– Type/selectTerminal: Create New Integrated Terminal
- Generate a ssh-key use
ssh-keygen
– In the terminal typessh-keygen
– Hit enter to each of the questions
– No, you do not need a passphrase - Copy your public key
– In the terminal typecat .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 withssh-rsa
ending with something likeusername@shell01
-
Go to github.com and add your SSH key
– make sure you’re logged in
– select your icon in the upper right
– select settings
– selectSSH and GPG Keys
from the options
– click the green buttonNew SSH key
– Paste your ssh-key you copied from above in there and hit enter - 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
-
Once your connected to
shell01
via instructions above open an integrated terminal
– Open the command pallet with F1 key
– Type/selectTerminal: Create New Integrated Terminal
-
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 andjohndoe@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.
-
Once your connected to
shell01
via instructions above open an integrated terminal
– Open the command pallet with F1 key
– Type/selectTerminal: Create New Integrated Terminal
-
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) -
Navigate to the file you want in the explorer within VSCode.
-
Select the file and DRAG it to your local machine desktop or another folder from your file explorer.