Configuring a Remote Development Environment

  1. Open “Visual Studio Code”

  2. Click on the “Extensions” button on the left (Looks like a set of blocks)

  3. Search for and Install the “Remote - SSH” extension

[Remote - SSH Extension Search](ssh

  1. Click “Terminal” in the Menu Bar then choose “New Terminal”

  2. Type in the following command

ssh-keygen
  1. Press enter until the prompt is shown again (after some randomart is displayed)
Output of Terminal after invoking ssh-keygen
  1. Type in the following command
code ~/.ssh/id_rsa.pub

If the code command is not found then you can Open the Command Palette (Ctrl-Shift-P on Windows, Cmd-Shift-P on macOS) and search for “Install code command in PATH”

A document should open in the top part of your Visual Studio Code window

IMPORTANT Scroll all the way to the right and make sure there are NO spaces after the @ sign. If there are, just delete the spaces and save the file

Contents of id_rsa.pub
  1. Click on the bottom-left of the window (a green >< icon)

  2. Click “Remote SSH - Open Configuration File”

  3. Choose the first listed one (where it lists a .ssh/config file in your account directory)

SSH configuration file prompt
  1. Change the contents of this file to be of this form:
Host    linuxlab
    Hostname <a linuxlab machine name>
    User    <your millersville login name>

A list of linux lab machines can be found on MUCS Secure Connections webpage (https://www.millersville.edu/computerscience/mucs-secure-connections.php)

NOTE: the <angled brackets> are just placeholders. Remove them from the file. For example, Dr. Killian’s file looks like this:

Host    linuxlab
    HostName floyd.cs.millersville.edu
    User    wkillian
Example ssh configuration file
  1. Save the file

  2. Click on the bottom-left of the window again and choose “Remote SSH - Connect to Host…”

  3. Choose “linuxlab”

  4. If a popup for Windows Firewall or any Anti-Virus Software appears, ensure that you allow connections on Public and Private networks

  5. If prompted, choose “Linux” as the remote Operating System

  6. If prompted, click “Continue”

  7. Enter your Millersville account password

  8. In the new Visual Studio Code window, Click “Terminal > New Terminal”

  9. In the terminal, type in the following commands:

mkdir -p ~/.ssh
chmod 705 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
code ~/.ssh/authorized_keys
  1. Take the contents of the other Window (the id_rsa.pub file) and copy them to the end of the file.

  2. Save the authorized_keys file.

  3. Sanity check: close down Visual Studio Code completely, relaunch Visual Studio Code, and repeat steps 13 and 14. You should not be prompted to enter your password at all.