Skip to content

SSH Configuration

This article shows how to configure some shortcuts for SSH. The configuration file format is identical for Linux, macOS, and Windows. The configuration file location is also identical, relative to your home folder/directory.

This is optional but saves a little typing every time you want to login to Picotte. Visual Studio Code can also read this config file for information about remote hosts.

For Linux and macOS (which is Linux-like), the tilde character "~" is shorthand for the home directory, i.e. /home/juser.

Use any text editor like VisualStudio Code to edit the file.

Configuration file location

  • Linux: ~/.ssh/config
  • macOS: ~/.ssh/config
  • Windows: C:\Users\myname/.ssh/config -- N.B. the forward slash "/" is not a typo; PowerShell will properly interpret them

When you start up a terminal in any of these operating systems, you will be put in your home directory. So, you will only need to do the equivalent of "edit .ssh/config".

Using VS Code

You can use VS Code and its Remote Explorer extension to edit the configuration file. In the left side toolbar, click the Remote Explorer button. And then, click the gear icon to configure, and select the first option.

See: Visual Studio Code setup

This process is demonstrated in a video on setting up VS Code available on Drexel Streams (Kaltura).

Configuration

In the following, juser is the username on Picotte.

You can define user-hostname configurations with shortcuts, e.g.

Host picotte001
    HostName picotte001.urcf.drexel.edu
    User juser

This allows you to type "ssh picotte001" rather than "ssh juser@picotte001.urcf.drexel.edu".

You can define multiple "Hosts" including very short ones, too:

Host picotte001 picotte p
    HostName picotte001.urcf.drexel.edu
    User juser

This allows "ssh p" to login Picotte.

See Also