Monday, September 11, 2006

Creating Public / Private DSA Key Pair

Generating a public/private DSA key pair is easy. The following generates a password less key pair


fmashraqi@frank[~]$ ssh-keygen -N "" -t dsa -f ~/.ssh/id_dsa_svn
Generating public/private dsa key pair.
Your identification has been saved in /home/fmashraqi/.ssh/id_dsa_svn.
Your public key has been saved in /home/fmashraqi/.ssh/id_dsa_svn.pub.
The key fingerprint is:
0a:fc:a4:b9:8c:ae:67:dd:d9:1d:68:2c:33:20:54:1a fmashraqi@frank



Now we can view our public key by using cat and mail it to ourself.

cat ~/.ssh/id_dsa_svn.pub | mail myemail


Now on the server to which you want to connect without using password, append your .pub key to ~/.ssh/authorized_keys

Optionally, you can add a command prefix to your entry in authorized_keys file. Then only selected commands will be able to use the key.

command="/usr/bin/svnserve -t" ssh-dss AAAAB3NzaC1kc3MAAACBAJpWqD8qjQFNFDA
OQ2bqpjE1eGQXAkwsmp/TFe/ScK91hCUMDmj9ivYfG6FYMcC0pigb3B5Z19rvd


Now use svn and ssh
svn co svn+ssh://url/to/repo