keychain

dams on 2008-02-25T12:07:41

On our way back from FOSDEM, I had a quick discussion about ssh with Chris, and it motivated me to clean up all my ssh keys, passphrases, agents.

So now I use different keys for work and home, and ssh keychain on both.

Next move is to add my work identity to my home session to be able to connect directly to servers at work without having to go through my workstation at work. Without putting my home private id on my machine at work, nor copying my home public id on all servers at work. It should be possible I've heard :)

Anyway, here is briefly how I did it : ssh-keygen (dsa as main key). Then install keychain (see http://www.gentoo.org/proj/en/keychain and configure it a bit. I added the following script in /etc/profile.d/keychain.sh (gentoo host), and I plan to use http://www.sshkeychain.org on my mac.

#!/bin/bash
# start keychain, with the private keys to be cached
/usr/bin/keychain ~/.ssh/id_dsa
# then load the generated files
for i in ~/.keychain/*-sh*; do
echo "sourcing $i"
source $i
done

I know, I know, everybody is supposed to know everything about ssh, but I'm happy to admit that I learnt 2 or 3 things while setting up everything properly. Besides, how many of you have no passphrase on your ssh key ? :)


Re: keychain

mattk on 2008-02-26T02:54:15

You don't need SSHKeychain if you're running Leopard - it starts up ssh-agent on boot, exports SSH_AUTH_SOCK, and even integrates nicely with the system keychain.

Re: keychain

dams on 2008-03-16T13:04:16

Indeed, I discovered it just after posting this entry :) I like mac os X for these kind of good surprises from time to time... Anyway, thanks for the tip.