Posted  15 Jul 2009 - 14:42:36

Category: Linux

Login with public key via SSH to server

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.

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/

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 'test -d .ssh || mkdir -m 0700 .ssh ; cat >> .ssh/authorized_keys && chmod 0600 .ssh/*' < ~/.ssh/

© SolutionCottage 2008-2011 9/23/2017 11:50:01 AM