Quick Tip: SSH Config

August 22nd, 2008

It’s easy to create shortcuts for all those servers you need to SSH into. There should be a file in your .ssh directory called config. Simply add a few lines to this file and you can refer to those servers by their short name.

Example (~/.ssh/config)

Host foo
  Hostname some.long.hostname.you.cannot.remember.com
  User myuser
  Port 1234

Now you can use your new host when you SSH.

ssh foo

If you want to get even fancier, read the man page for additional options.

man ssh_config

Setup as many as you need and free yourself from SSH hostname hell!

2 Responses to “Quick Tip: SSH Config”

  1. Wow. I never heard about that until now. Thanks for sharing! It’s going to make using sftp a lot less painful.

     
  2. Hmmm. NIce Curtis. I always just create an alias in by .bash_profile, but this seems cleaner.

     

Leave a Reply