Visual Studio Code

Visual Studio Code is a free editor application (similar to Atom) that works for all three major operating systems (Windows, Mac, Linux) and has the ability to edit remote files; that is, to edit files on a machine that you would have to SSH to. Very cool!

Installation on a Mac

  1. Download the VSC application (for the Mac) from the homepage or download page.
  2. Install the application, by clicking the icon for the .zip file in the Downloads folder. You'll see something like this:
    Unzipped VSC application in the download folder
  3. Double-click the unzipped application in the finder window.
  4. Approve the opening of the application by clicking "open"
  5. The application will launch and then automatically open some documentation windows.
  6. Go to the Extension page and install the Remote Development extension. We will probably install other extensions later. You'll have to click a few confirmation windows, including a final green "install" button in the VSC application itself: install remote development from within VSC
  7. I suggest right-clicking on the icon in the Dock and clicking "Options / Keep in Dock".

SSH Usage

After the installation steps above, and after launching the VSC application, you can use it to edit remote files:

  1. In the lower left of the VSC window, you'll see a green icon that looks like this:
    VSC remote icon
  2. Click on the green icon (hover says: "open a remote window"). At the top of VSC, you'll see a menu like this:
    VSC remote menu
  3. Choose "Remote-SSH: Connect to Host" and connect to youraccount@cs.wellesley.edu. Looks like this:
    VSC remote login
  4. It'll ask for your password in the next step.
  5. If you succeed, the lower left of the VSC window will show the remote connection, like this:
    VSC remote session

Navigation

Editing files on the remote machine is pretty straightforward:

  1. Click on the Explorer Icon (or command-shift-e)
  2. Choose "Open Folder" under connected SSH
  3. Choose a folder on your remote machine, such as public_html

SSH Terminal

To run commands on the remote machine, you'll need a terminal:

  1. On the Terminal menu, choose "New Terminal". This opens a remote (SSH) terminal!
  2. cd to public_html
  3. do an ls to see your files and folders

Exit

SSH Keys

Later, we'll talk about SSH keys, to avoid having to constantly re-authenticate.

  1. This work is licensed under a Creative Commons License
  2. Creative Commons License
  3. Viewable With Any
Browser
  4. Valid HTML 4.01!
  5. Valid CSS!