12 February 2013

uhm, there is a ~/.ssh/config file?

How did I miss this for all these years I've used ssh?


~/.ssh/config lets you type 
#ssh home
instead of
#finn@84.215.xxx.xxx -p 10001

Here is the ~/.ssh/config
Host home
HostName 84.215.xxx.xxx
Port 10001
User finn


Combine this passwordless ssh with
ssh-copy-id -i ~/.ssh/id_rsa.pub finn@84.215.xxx.xxx
and phoning home is pretty effortless.

... another one of those note-to-future-Finn (tm) posts which I'll copy and paste stuff from.

2 comments:

  1. Two more nice things you can set:

    ForwardX11 yes
    (to forward x)

    And, as i learned today, use aliases for example
    Host test dev stage prod
    User finn
    HostName %s.blogspot.no

    ReplyDelete
  2. You can also specify what identity file you want to use per host

    Host home
    HostName 84.215.xxx.xxx
    Port 10001
    User finn
    IdentityFile ~/.ssh/id_rsa.pub

    $ ssh home

    ReplyDelete