Sunday, April 25, 2010

SSH Hostname Shortcut

As I work with 3 machines: laptop, desktop, and a server: all running 64-bit Linux, I often need to use ssh and scp. I find repeated typing of long hostnames stress inducing, with the chance of making a typo or just the pressure on my fingers. Here is a trick I use.

Create a file .ssh/config with the following entries:

Host [shortcut]
Hostname [full-hostname]
User [username]

where entries in [brackets] are to be filled with your entries. Additional entries like Port, ServerAliveInterval, etc. can also be filled out.

This along with public key based password-less ssh works like a charm. If you are as lazy (= productive) as I am, one-letter shortcuts for frequently used hosts like

$ ssh a

is enough.

1 comment:

  1. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete