简体   繁体   中英

Global Subversion SSH config in Windows / Checking out Subversion project as SYSTEM on Windows

I'm trying to set up a scheduled Subversion commit from Windows Server 2003 machine over SVN+SSH as a task. I'd like the commit script to be executed as SYSTEM-user. So I'm guessing, for that to work I need to check-out the repository as SYSTEM, too - but am unable to achieve it so far.

I'm already able to achieve the above with my own user over SSH. I've done the following:

  1. I added a [tunnels] entity in my local subversion configuration:

    ssh = plink.exe -i "C:/Keys/my_key.ppk"

  2. Added the key to the authorized_keys file on the server running Subversion

  3. I checked out the repository with a script as below:

    svn co svn+ssh://user@server/path/to/repo/ C:\\Local\\Project\\Path

I'd now like to reproduce the above steps for SYSTEM user, to be able to run a scheduled commit later. The problem I'm facing is I don't know how to check out the repository as SYSTEM, because:

  1. I don't know the syntax to use to check out a repository as SYSTEM
  2. I don't know where the global (or SYSTEM's) Subversion config is stored on a Windows Server 2003. I've already tried: C:\\Documents and Settings\\Default User\\Application Data\\Subversion and C:\\Documents and Settings\\Administrator\\Application Data\\Subversion , but without success.

I also read somewhere I possibly could use svn switch for what I want, but wouldn't know how to svn switch as SYSTEM. I also considered writing scripts for svn check-out or switch and running them as SYSTEM, but then I still need global SVN config to add my_key.ppk , too.

I hope the above description is clear enough. I've been struggling with it for a long time now and am having problems summarizing it myself. Any hints appreciated.

As a side, that doesn't seem to be totally off-topic: https://serverfault.com/q/9325/122307

This is not a real answer to your question, yet it might solve your problem: Why not use svn <command> --config-dir ARG or svn <command> --config-option ARG ?

You could specify the config file/option like this, thus being able to set [tunnels].

@cxxl really answered on question, when mentioned --config-dir . I'll just try to shed some light on problem

I'm guessing, for that to work I need to check-out the repository as SYSTEM

Wrong and bad guessing, because stored locally user's auth data doesn't used in case of SSH-auth, for ssh remote authentication performed. Per-user auth-dir

\%AppData%\Subversion\auth>dir /W
...
[svn.simple]                [svn.ssl.client-passphrase]
[svn.ssl.server]            [svn.username]
...

contain stored credentials only for http|https|svn and cert-based client authentication, and nothing for ssh-related repositories

Ie your executed under LSA script must be able to * read Working Copy files (checkouted under any other real local user), maybe write (can't recall requirement for .svn dir permissions) * read and, thus, use predefined and fine-tuned Subversion's config files (tunnel section), which can be config of any other user

PS: swn switch change linked URL of repository for Working Copy and have nothing common with users

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM