SSH is great. There is so many thing you can do with it other than just a remote secure shell like X forwarding, port forwarding, authenticate using a private/public key, compress the transmitted stream....

If you have different account that you use on an every day basis, it becomes quickly cumbersome to type those lengthly command lines.

One could work around this by using aliases, the right way would be to use ~/.ssh/config

This tutorial will show some customization examples that should cover most ssh use cases.

All along this tutorial, the changes will be made in ~/.ssh/config and will therefore be available only for your user. If you wish to make changes server wide, you will have to edit /etc/ssh/ssh_config .

1. A simple example

Most of your ssh connection might look like:

$ ssh user1@server1.example.com

By adding the following to your ~/.ssh/config :

Host server1
Hostname server1.example.com
User user1

You can shorten the typing to:

$ ssh server1

2. Adding Public/Private key authentication

If you identity file is named ~/.ssh/id_rsa or ~/.ssh/id_dsa , those file will be tried automatically by ssh. In case you have different key files, you have to inform ssh about it with -i , which look like: