SSH: save time with host shortcuts

If you work with SSH a lot from the command line then repeatedly typing in full hostnames can be cumbersome and tiring. In this quick post I'll show you how to setup up hostname shortcuts to save you time on the command line.

Let's assume you have a host painstakingly called luke-skywalker@deathstar.com then by adding the following to your ~/.ssh/config (you may have to create it first):
  Host luke
HostName luke-skywalker@deathstar.com

Now the next time you want to connect all you have to type is:
  $ ssh luke

This hostname expansion works for all commands in ssh family, including sftp and scp. It also works for programs that use ssh to connect remotely, including rsync, cvs and subversion.
|