8

I want to do

svn update /Users/radek/Sites/3.0.5/ -r HEAD --force

without the need of typing the password.

svn connects to our repository server but I am not sure under what username (how can I find out?). I guess it would be either root or radek

The password I type for svn to proceed is the same like root's one on repository server so I added my public key to root's authorized_keys file. So I ssh to repository server without typing password but it did not affect svn asking for password at all. The password of user radek on repository server is different to the one I type for svn up

If I commit something form Eclipse the author is radek.

Solution

svn info

told as which user I have to log in into repository server and then I added public key to its authorized_keys file. Now I do not have to enter pass when using svn.

3
  • Did you run the ssh agent? Did you add your secret key to the agent? Commented Feb 25, 2011 at 5:46
  • Not about programming. Voted to migrate to superuser.stackexchange.com Commented Feb 25, 2011 at 6:20
  • 1
    i'm a programmer and this helped me write a program to automate svn checkins of my programs. Commented Jan 6, 2013 at 5:53

2 Answers 2

6

There is a program called "ssh-agent" that will save an unlocked RSA or DSA key in memory and supply this key to SSH through a UNIX socket. This can be used for "password-less" SSH connections, assuming you generate an RSA or DSA public/private key pair, and add the public key to the "authorized_keys" or "authorized_keys2" file of the remote host. When you first add a key to ssh-agent or turn on ssh-agent, you will need to supply your password, but subsequent uses of SSH can occur without a password. You may find the following articles helpful in terms of setting up SSH agent:

Note that on Mac OS X (as of 10.5 and higher), if you generate the private/public key pair and put the public key in the authorized_keys file of the remote host, when you SSH into that host, Mac OS X will automatically start up its own ssh-agent (no setup required) and offer to remember the password (it will save it in KeyChain). You can read more about that on Mac OS X Leopard -- Built-In SSH Agent.

Sign up to request clarification or add additional context in comments.

4 Comments

I am on OS X 10.6.2 and I added public key to the root's "authorized_keys" on the repository server but it didn't help. Or am I missing something?
Unless you are authenticating as root, you shouldn't be putting it there; you should put it under "~/.ssh/authorized_keys2" on the remote host. You also have to make sure that the host is configured to allow for the use of these keys (some systems are configured to disallow this).
~ is home directory, right? The password I have to type is not the one for user 'radek' but 'root' I can log into the repository server without typing any password as root but it didn't help. Still have to type svn password for svn
"Shortest passwordless ssh tutorial" is also broken. I've edited it to point to a copy elsewhere
3

If you can't use a key file, use sshpass (in Linux):

Install sshpass

$ sudo apt-get install sshpass

Set the temporary environment variable

$ export SSHPASS=yourpass

Edit the svn config file

$ nano ~/.subversion/config

Finally comment out add sshpass -e to ssh line, before the ssh command

ssh = $SVN_SSH sshpass -e ssh -q -o ControlMaster=no

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.