SSH Cheat Sheet

Table of Contents


Defining a short name for a system

Edit ~/.ssh/config and add the following:

Host foo
User bmc
IdentityFile ~/.ssh/id_rsa

You can also use this approach to specify keyfiles that aren’t in the standard location. For instance:

Host ec2prod
User root
IdentityFile ~/.ec2/production-keypair

After saving ~/.ssh/config, you can use the alias names as if they were actual host name:

$ ssh ec2prod