Nov 19, 2008

Keychain, ssh-agent, and linux

You may have arrived at using ssh-agent a number of ways. I got here by necessity.. Capistrano wouldn't play nice while pulling code from my public key protected git repository without it. Still, I got tired of typing in the commands every time and adding them to my .bash_login file didn't help. Enter keychain.
The linux version of keychain shouldn't be confused with the well known Mac OS X equivalent (though this version also does run on OS X). The version of keychain I'm talking about simply manages your ssh keys. Getting it up and running on Ubuntu or Debian is pretty straight forward:

Step 1: Install the packages!
sudo apt-get install keychain
sudo apt-get install ssh-askpass


Step 2: Fire it up!
keychain ~/.ssh/id_rsa


The above assumes you have your private key in the .ssh/ folder and that it's called id_rsa. Also, you may not need ssh-askpass, but if you don't install it you may get an error that says something like ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory.

No comments:

Post a Comment