1
votes

I'm using an SVN repo over SSH and I would like to use the svn command line tool with the svn+ssh schema from a generic account that people share to do builds of the same code.

We use ant to build at present like so. You can see that it prompts for an user/password which has privileges into SVN

<target name="update">
        <input message="username:" addproperty="username" />
        <input message="password:" addproperty="password" />

        <svn username="${username}" password="${password}">
            <update dir="${my.dir}"/>
        </svn>
</target>

When you try to use svn {command} svn+ssh/repo on the command line (on Solaris), ssh defaults to using the current user. The current user is a generic account which has no privleges into the SVN repo.

I want svn to prompt me for the user and password.

I know I can pass in my username to svn like so

svn info svn+ssh://me@svn-server/apps/app

but that's no good if I want to put it in a script to be used by anyone using the build server's generic account

What I want is to be prompted but the command line, just like the ant task does.

Is there a way to achieve this?

I've tried moving all the entries in the .subversion/auth dir out of the way and uncommenting store-passwords = no and store-auth-creds = no in the .subversion/config file

If not, how is ant doing it?

Thanks

1

1 Answers

0
votes

You could use the ~/.ssh/config file to specify a username for that particular repository, e.g.

http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/

You can specify different usernames for different hosts, etc.

From the ssh man pages, you can use the -F option to tell ssh to use a specific configuration file (instead of ~/.ssh/config, which is the default).

Since you're using a script anyway, could you get your script to prompt the user for a username and then create a config file using the entered username?