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 [email protected]:~/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
I was basically an agnostic/atheist until I was 25. I am now a Christian and I have poked and prodded at the scriptures for twenty years and have found it very solid ground.
Hello,
Very helpful information, thanks! This feature should be more exposed, its really great. For some reason, entering a user does not work for me…
The previous comments are hilarious!
Nevermind, I typo’d the file name. Derp.
[...] Astuces SSH %A %e %B %Y | Auteur Grand chef Source: movetoiceland.com [...]