Quick Tip: SSH Config

Posted by Curtis Miller Curtis Miller

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!

Velocity Labs

Need web application development, maintenance for your existing app, or a third party code review?

Velocity Labs can help.

Hire us!