How to make Subversion use Linux system accounts for authentication?

后端 未结 3 746
慢半拍i
慢半拍i 2021-02-04 12:31

I\'ve set up a Ubuntu Server for Subversion with Apache/WebDAV interface to share repositories with other developers. My question is, how can I make Subversion use the linux sys

3条回答
  •  猫巷女王i
    2021-02-04 13:05

    Ok! I did it! And I thought it would be very hard to find the answer!

    We have to tell Apache to use an "external authentication provider", Apache won't be checking for authentication, but will delegate the task to an external authenticator, in this case, the marvellous pwauth.

    So the steps I did to make it work was:

    1. Install Mod_Auth_External module for Apache2 and pwauth

      sudo apt-get install libapache2-mod-authnz-external pwauth
      
    2. Enabled the new module for Apache: sudo a2enmod authnz_external in terminal.

    3. Configured my apache.conf (or you may have httpd.conf) to add the external authenticator (based on this article):

      AddExternalAuth pwauth /usr/local/libexec/pwauth
      SetExternalAuthMethod pwauth pipe
      
    4. Edited my /etc/apache2/mods-available/dav_svn.conf to set the new external auth provider:

      ...
      AuthType Basic
      AuthName "Subversion Repository"
      AuthBasicProvider external
      AuthExternal pwauth
      Require valid-user
      ...
      
    5. Tested and worked fine!

提交回复
热议问题