unoverse

Posted:

SSH config

Connecting to servers with SSH often will pretty fast turn in to a tedious task especially if you, like me, connecting with different users on different IP addresses with different keys. I do this almost daily.

Luckily there is a very nice solution and that’s the SSH configuration file where you can define all of this so you don’t need to remember everything all the time.

Config file

It’s a very simple configuration and the configuration file lives in ~/.ssh/config. You can create the file if it’s not already there.

The format looks like this:

Host <alias>
  Hostname <domain or ip>
  User <username>
  Identityfile </path/to/key>

Connect

Now we can easily connect with just ssh blog instead, much simpler. This of course also applies to scp.