European Open Root Server Network

ssh public key authentication with ssh-agent

Generate a key:

ssh-keygen -b 1024 -t dsa -C j.doe@example.com

Distribute the key:

ssh root@cleaner4 "cat >> .ssh/authorized_keys" < .ssh/id_dsa.pub

Make sure ssh-agent is running. KDE user add the following lines to their /etc/kde/startup/agent-startup.sh (Gentoo):

if [ -x /usr/bin/ssh-agent ]; then
	eval "$(/usr/bin/ssh-agent -s -t 3600)"
fi

KDE now starts ssh-agent at every login. To unlock the ssh-key with your secret passphrase use the following command:

ssh-add

If you have an ASCII-armored keyfile, you can convert ist to a authorized_keys compatible line usig:

ssh-keygen -i -f ssh-key.ascii