Support / KnowledgeBase

 
Search the KnowledgeBase Search

Preventing multiple password prompts when using svn (subversion)

  • Applies to: (gs)

  • Difficulty: Medium

  • Time needed: 5 minutes

  • Tools needed: ssh, vi

 

This article has the following dependencies:


  • Please make sure you have a basic understanding of SSH and have access enabled.
  • This article assumes you already have configured a working repository on your (gs) Grid-Service.
  • mt-example.com is used as an example. Please be sure to replace this text with the proper information for your site or server.
  •  

    On the (gs) Grid-Service we exclusively use the svn+ssh:// scheme, and not http://.  For this reason it is normal to experience multiple password prompts for every outbound connection.

    The solution is to use a separate SSH password-caching tool like ssh-agent on a Unix system. For more details please see below: 1 

    The steps outlined below would work on any UNIX system, such as OS X or Ubuntu.

    Before beginning this article you should complete the following articles first:

    After following the articles above we can proceed. 


    WARNING:

    This article assumes you are using bash, which is the default shell in OS X and Ubuntu.  If you are using a different shell look for an alternative solution using other online resources.


     1. Create a file called .profile in your home directory using vi or your favorite Unix text editor.  It is possible that you already have this file.  If so we will simply add to it:

    vi ~/.profile

     2. Place the following code inside and save your file.  This piece of code will see if you’ve already started ssh-agent.  If you haven't already started the process it will start ssh-agent, and store the settings to be usable the next time you start up a shell:

    SSH_ENV=$HOME/.ssh/environment
    
    function start_agent {
         echo "Initialising new SSH agent..."
         /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
         echo succeeded
         chmod 600 ${SSH_ENV}
         . ${SSH_ENV} > /dev/null
         /usr/bin/ssh-add;
    }
    
    # Source SSH settings, if applicable
    
    if [ -f "${SSH_ENV}" ]; then
         . ${SSH_ENV} > /dev/null
         #ps ${SSH_AGENT_PID} doesn’t work under cywgin
         ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
             start_agent;
         }
    else
         start_agent;
    fi
    

     3. After saving the file close your terminal and open a new one.  You should see something similar to:

    Initialising new SSH agent...
    succeeded
    Identity added: /Users/username/.ssh/id_rsa (/Users/username/.ssh/id_rsa)

     

    4. Now you should be able to run all your svn commands without any more of those password prompts!

    Notes/Supplemental Resources:

    Revisions:


    2009-01-23: Article Creation

    1. http://svnbook.red-bean.com/en/1.4/svn.serverconfig.svnserve.html [Snap Back]

    User Comments

    No visitor comments posted. Post a comment

    Fields marked with an asterisk(*) are required. Comment on this article

    Fill out the form below if you would like to comment on this article.
     
     
     

    (code is not case-sensitive)
     
    Submit
     
     

    Continue