Insights on Ruby, Git, jQuery, Cappuccino, WordPress, Debian and OS X. Please subscribe if you find something useful!

Avoid Sore Fingers While SSHing Around

Posted: May 14th, 2009 | Author: Jerod | Filed under: Debian | Tags: , | Comments

If you’re anything like me, you’ve gotten accustomed to commands like this:

ssh [user]@[remote.server.com]

If you find yourself connecting to the same machines repeatedly, save a few keystrokes by creating a handy alias for them. Create (or edit) “~/.ssh/config” and add as many of these as your little heart desires:

Host [the alias]
HostName [domain name or IP address]
User [the account to login as]

Now you don’t have to use the full command to access the machine, just use the alias! For example, here is how I access one of my DreamHost servers:

ssh dh

The same goes for SCP! So, to secure copy a file (my_file.txt) in my current directory to the same machine I would simply issue:

scp my_file.txt dh:

Ahh… that is easy on the fingers! What else can we do with SSH config files?


blog comments powered by Disqus