Tired of entering you svn password everytime?

I have set up svn repositories on dedicated Linux server of my clients but the constant typing of svn password everytime I access the repository makes life for a developer less livable. Until I found the solution…

So here it is, follow the step and hurray!

  1. Generate an SSH key pair of your Linux workstation so that you can set up automatic authentication (no more password asking). If you’ve already generated a DSA key pair, skip to step 2. Open a Terminal window. (On OS X, you can find this in /Applications/Utilities/Terminal)
    ssh-keygen -b 1024 -t dsa

    Do not enter a passphrase. Hit enter when prompted for one.

  2. Execute the following to display your public key:
    cat ~/.ssh/id_dsa.pub

    Copy the output to the clipboard.

  3. Log into your Server’s account’s shell via SSH. Once you’re logged in, execute
    cd .ssh

    If the directory doesn’t exist, create it:

    mkdir .ssh
    cd .ssh
  4. Execute the command
    vi ~/.ssh/authorized_keys

    Hit i to enter Insert mode and then paste your public key (if there is already a key in this file, move to the bottom before pasting). Hit the ESC key to leave Insert mode and type :wq and hit enter to save and exit vi.

That’s it, no more password typing while doing your svn stuff.  Go ahead and try your svn commands.

Tortoise guide to do the same on Windows.

7 Comments

  1. Owen:

    Adding the svn pass to your kechain is usually the typical solution and the typical setup. I’m surprised that your setup wasn’t installed in such a way that it added it automatically.

  2. Owen,

    Right, I was surprised also to find out that I am asked to enter the svn password every time. Though my svn setup on my hosting server is now working perfectly, I’ll try to set it up in the typical setup you described here. I only need to find some time.

    Thanks for dropping a comment.

  3. talv:

    great article! ive just set up my own repository and this password thing was driving me crazy!!! =D

  4. talv, I’m glad to know this article was useful for you!

  5. Eduardo:

    I had the same problem but I fix it in another way.
    I removed my subversion profile: sudo rm -rf ~/.subversion
    use a svn command to regenerate it and now it worked.

  6. I’d like to add a step in case it didn’t work with the instructions above. If you are still being asked for the password then you need to check the file permissions for the files in ~/.ssh

    If those files are readable/writable by the group/world then it won’t work. You need to do this:

    chmod -R go-rw ~/.ssh

    Source: http://mah.everybody.org/docs/ssh

  7. Thanks for this writeup! It’s a pain to have to use the password for every commit (now more than 245), and it’s my laziness that held me back from setting up the key pair - now it works great!

Leave a comment