Adam Williams

So I don't have to remember this later




SSH config file

The ssh client uses the ~/.ssh/config file for configuration data. If you ssh into servers often, it’s a great place to keep options you’d otherwise add to a bash aliases or just enter each time.

Verbose example (no config):

ssh -i ~/.ssh/Amazon.pem

Could be shortened to (with config):

ssh my-ec2-server

Add the following to the file ~/.ssh/config (you may need to create the file first)

Host my-ec2-server
        User ubuntu
        IdentityFile ~/.ssh/amazon.pem

Many more options are possible in ~/.ssh/config. See man 5 ssh_config

Sources: man 5 ssh_config, Simplify Your Life With an SSH Config File