SSH – Assigning a Name to an IP

If you find yourself using SSH extensively like myself, then I’m sure you’re sick of typing out IPs constantly as you’re trying to log in. This can easily be resolved by adding it as a known host in SSH. This also comes in handy when you’re using a non standard SSH port and you need to connect through something like SVN.

pico ~/.ssh/config

Now enter something like the following:

host subversion
Hostname yourDomainOrIP.com
Port 22


Tags: , , , , , ,

  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

4 Responses to “SSH – Assigning a Name to an IP”

  1. BjornSlippy says:

    Out of interest, why would you do that in the ssh config and not just add the host to /etc/hosts?

  2. Because if you do it in the SSH file, you can add extra options like the port number to connect to, the username to use, whether to enable X11 forwarding, port forwarding mappings, etc.

  3. kevmitch says:

    Because not everyone has access to /etc/hosts

  4. psilokan says:

    Exactly, I typically dont run my SSH server on port 22. And when setting up SVN+SSH its much easier to do it this way.

Leave a Reply