2009-11-23 · in Tech Notes · 94 words

I find it useful to have shell aliases set up for the machines that I connect to with SSH, so I can type myrtle (or myrtle ps -ef) rather than ssh myrtle. I used to configure these by hand, but it occurred to me that I already had entries for all these machines in my SSH config file so that I could use the short names in other applications:

Host myrtle
    HostName myrtle.kent.ac.uk

My bash configuration now includes ssh.sh, which scans .ssh/config for Host foo lines, and creates a foo alias for each one.