Main menu:

Site search

Categories

September 2010
M T W T F S S
« Apr    
 12345
6789101112
13141516171819
20212223242526
27282930  

Archive

I also Post to

My Photos

www.flickr.com

My Badges

NO2ID - Stop ID cards and the database state

Kiva - loans that change lives

Simplify your use of ssh

Sometimes using ssh can be a bit of a pain, especially when you regularly log into different hosts with different usernames using different authentication methods. At work, I log into local Unix boxes using a DSA key. Sometimes though, I want to log into a box at Textdrive as a different user, using a password. The first thing it asks me in this circumstance is the passphrase for my key, which I don’t want to use. Also, I have to remember to pass the right flags to tell it the username I want to use. The answer in this case is to use the ssh config file which allows you to set up shortcuts. This just lives in your .ssh directory. Look at the man page for ssh. Here’s mine to allow me to log into textdrive very simply:

Host txd
RSAAuthentication no
PasswordAuthentication yes
HostName somebox.textdrive.com
User someuser
PubkeyAuthentication no

 

So now I just do ssh txd, it connects to the right place as the right user and it only asks me for a password, not for a passphrase.

Comments

Comment from Al
Time: 6 December 2006, 15:37

Very useful – thanks Chrs!!

Write a comment