Omit Needless Words

ssh aliases make me happy

Edit ~/.ssh/config (on your local machine). For example:

Host h
HostName host.remote.com
User gtcaz

This defines a new host (named h) which expands to host.remote.com and with gtcaz as the default user. What this allows is:

scp some_image.png h:www/images

Or

ssh h ls www/images

The first example copies some_image.png from a local folder to the www/images folder on the server. The second example logs into the server, executes an ls www/images, and gives back the result.

For more info about the ssh configuration file run man ssh_config.

Credit: Allan Odgaard and the MacroMates Blog.

Page 1 of 1