May 02, 2017

Configuring SSH Locally

We'll see how to configure your local SSH configuration to make logging into your servers easier.

We can make logging in over SSH much easier for ourselves. Here we're going to edit a config file on our local machines.

Let's make our lives a little easier by using our local workstation's ~/.ssh/config file:

  1. On Mac, tell it to use the keychain so we don't have to remember passwords (Unless used in automation, you should set long, annoying passwords on your SSH keys!)
  2. Setup a hostname to use as a shortcut to log into our server
Host *
    UseKeychain yes

Host sfhstart
    HostName <server-ip-address-or-hostname-here>
    User fideloper
    IdentityFile ~/.ssh/id_sfh_start
    IdentitiesOnly yes

Then we can simply login like this:

ssh sfhstart

Resources

All Topics