Running VSCode with SSH via ubuntu-vlab01.seas.gwu.edu
You can use this guide to instead develop using
ssh
connection toubuntu-vlab01.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 client
- 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 connected to the GW VPN to ssh into
vlab01
-
Open a new VSCode Window
– Open the command pallet with F1 key
– TypeRemote-SSH: Connect to host
and choose to connect to a new host
– Then enterssh gwusername@ubuntu-vlab01.seas.gwu.edu
wheregwusername
is your NetID for GW. Like in your emailgwusername@gwu.edu
– If prompted for the operating system, select Linux (not the OS of your machine), and hit select that you want to continue when it mentions a fingerprint. This is because Linux is the OS of the remote host.
– 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 ubuntu-vlab01.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.
Setting up your git profile on ubuntu-vlab01
You only need to do this once, but you need to do it in order for us to grade your work
-
Once your connected to
ubuntu-vlab01
via instructions above open an integrated terminal
– Open the command pallet with F1 key
– Type/selectTerminal: Create New 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.
Extra stuff
Setting up an SSH key on ubuntu-vlab01
with github
Note you only need to do this once
-
Once your connected to
ubuntu-vlab01
via instructions above open an integrated terminal
– Open the command pallet with F1 key
– Type/selectTerminal: Create New 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@ubuntu-vlab01
-
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
Retrieving files from ubuntu-vlab01 to your local machine
Note that when you work on
ubuntu-vlab01
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
ubuntu-vlab01
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 left
– 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.