Stupid SSH Tricks: A Better Hosts File
I’ve been noodling with SSH to make my life easier at work. One thing I found out about was how to make host aliases in your SSH config file. (It’s usually located at ~/.ssh/config). And it’s pretty easy to do. Here’s an example:
Host webhost User host_user HostName example.com IdentityFile ~/.ssh/some_id_dsa
The reason this is better than your hosts file (/private/etc/hosts) is because you can do things like scp ~/somefile.txt webhost:~/upload.txt and scp, since it uses ssh, will realize you want to do this: scp -i ~/.ssh/some_id_dsa ~/somefile.txt host_user@example.com:~/upload.txt
If you do a lot of sshing and scping like I do, you’ll find this extremely convenient. And if you use ssh keys, it makes working on multiple machines as easy as working on a local machine.
This has nothing to do with this post, but I linked here from an atheist blog and saw that you live in Lancaster, PA like I do. It’s difficult to find people of the same non-religious persuasion in this area, so I wanted to say hello. BTW, I like your daughter’s name. I have two sons myself, and I’m proudly raising them to be “heathens,” ha ha. Feel free to email back if you’d like. Thanks, Brooke