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.
Posted: December 4th, 2006 under unix.
Comments: 1
Comments
Comment from Al
Time: 6 December 2006, 15:37
Very useful – thanks Chrs!!


Write a comment