SolutionCottage.com
Posted  15 Jul 2009 - 14:42:36

Category: Linux


Login with public key via SSH to server

Issue:
When you're issuing svn commands you get the password prompt in your face the whole time. I got it two times for some reason. Well there is a solution to get rid of them all together.

Solution:
Begin by generating an ssh key on your local computer.

ssh-keygen -b 1024 -t dsa

Then echo your key and copy it to the clipboard.
cat ~/.ssh/id_dsa.pub

Lastly, log in to your server and open this file:
nano -w ~/.ssh/authorized_keys

Copy in your key you echoed previously and make sure everything is on one line!

Another thing you have to do is to ensure that the correct permissions are set to some of these files. authorized_keys on the server should have 600 and the parent folder .ssh should have 755.

That should be it, try issuing an svn command locally and you should not have to enter a password.








1 comment:

6/3/2010 2:32:23 PM  anthon  wrote:

nice one! Here condensed into a "single" command. Run after generating your local key: ssh username@ftp.yourdomain.com 'test -d .ssh || mkdir -m 0700 .ssh ; cat >> .ssh/authorized_keys && chmod 0600 .ssh/*' < ~/.ssh/id_dsa.pub









© SolutionCottage 2008-2011 7/26/2017 1:43:31 AM