在Ubuntu中保存SVN的SSL密码

我试图设置我的SVN,它保存我的密码,但由于某种原因,它不会工作。 我正在使用SSL证书,为此我需要每次提供密码。 我已经尝试在~/.subversion/servers文件中设置它:

 [mygroup] ssl-client-cert-file = /mnt/data/myuser/certificate.pk12 store-passwords = yes store-plaintext-passwords = yes store-ssl-client-cert-pp-plaintext = yes 

该文件是正确的,它find正确的path,并要求input密码。 有一段时间我尝试了这个,它问我是否要永久存储SSL密钥和密码,我一直都是。 SSL密钥被记住,但密码不是。 现在它甚至不要求记住它。 它只是每次都问。 我尝试了很多设置,没有工作。 有任何想法吗? 谢谢

在Subversion 1.8+中,似乎有一个错误/回归,它无法存储证书密码。 我在这里回答,希望有人会觉得有用,并节省一些时间。

一个解决scheme是使用kwallet作为密码存储。 有一个非常好的方法: http : //mail-archives.apache.org/mod_mbox/subversion-users/201406.mbox/%[email protected]%3E 。 转发这里的步骤,所有功劳原作者 – 西蒙。

鉴于你告诉我,我能够find一个解决方法,并手动创build密码存储:

  1. .subversion / config:[auth]部分设置为“password-stores = kwallet”
  2. 运行“kwalletmanager”,通过“系统托盘”打开kwallet
  3. 打开默认钱包,并创build新的顶级“Subversion”文件夹(与表格数据,密码一起)
  4. 在Subversion文件夹中select“密码”,然后用“@”+ path_to_p12创build一个新密码,比如“@ / home / nc / nc.p12”
  5. 为这个键input密码到kwallet

注意svn试图从“strace -e trace = lstat svn ls http:// ….”中获取数据,例如揭示/home/nc/.subversion/auth/svn.ssl.client-passphrase/345983d745d98273c095e872a09“

填充这个“345983d745d98273c095e872a09”文件与例如:

K 15 svn:realmstring V 45 /home/nc/nc.p12 END

与此同时,这可能有助于某人。 请注意,我的用户名是从证书通用名称派生的,否则我认为您需要“用户名@”作为密码。


受上述解决scheme的启发,我设法使它与gnome-keyring一起工作。 大多数步骤是相同的​​:

.subversion /服务器的内容:

 store-auth-creds = yes ssl-client-cert-file = /mnt/data/myuser/certificate.pk12 ssl-authority-files = /some/path/to/CA_if_needed.pem store-passwords = yes store-plaintext-passwords = no store-ssl-client-cert-pp = yes store-ssl-client-cert-pp-plaintext = no 

findsvn正在尝试读取的文件。 在一些svn命令上运行strace,比如strace svn up ,你应该看到类似“/home/user/.subversion/auth/svn.ssl.client-passphrase/b97ec2acbc64a5c8634a2307cd100b13”的东西。 用这些内容创build该文件: K 15 svn:realmstring V 33 /mnt/data/myuser/certificate.pk12 END您的情况path可能会有所不同。 另外请确保用您的pathstring的长度replaceV 33

现在,棘手的部分 – 手动将密码保存到gnome-keyring中。 由于海马无法为我创buildnetworking密码,因此我使用了一个小小的python脚本。 Debian / Ubuntu用户需要使用“python-gnomekeyring”包才能正常工作。

 #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk import gnomekeyring def hack(): gnomekeyring.item_create_sync(None, gnomekeyring.ITEM_NETWORK_PASSWORD, "svn cert pwd", {"domain" : "/mnt/data/myuser/certificate.pk12"}, "Secret_Passphrase_Goes_Here", True) if __name__ == '__main__': hack() 

这将在默认钥匙串中创build一个networking密码。 “域”必须与我们刚刚创build的svn config中的证书path匹配。

你可以用海马来检查一切是否成功。 现在颠覆应该能够从gnome-keyring中读取,而且不再需要每次input密码!

请进行如下更改并进行确认。

~/.subversion/config文件中: – (更改为)

 ### Section for authentication and authorization customizations. [auth] ### Set password stores used by Subversion. They should be ### delimited by spaces or commas. The order of values determines ### the order in which password stores are used. ### Valid password stores: ### gnome-keyring (Unix-like systems) ### kwallet (Unix-like systems) ### gpg-agent (Unix-like systems) ### keychain (Mac OS X) ### windows-cryptoapi (Windows) password-stores = gpg-agent,gnome-keyring,kwallet ### To disable all password stores, use an empty list: password-stores = yes ### ### Set ssl-client-cert-file-prompt to 'yes' to cause the client ### to prompt for a path to a client cert file when the server ### requests a client cert but no client cert file is found in the ### expected place (see the 'ssl-client-cert-file' option in the ### 'servers' configuration file). Defaults to 'no'. ssl-client-cert-file-prompt = yes ### ### The rest of the [auth] section in this file has been deprecated. ### Both 'store-passwords' and 'store-auth-creds' can now be ### specified in the 'servers' file in your config directory ### and are documented there. Anything specified in this section ### is overridden by settings specified in the 'servers' file. store-passwords = yes store-auth-creds = yes ### Section for configuring external helper applications. 

~/.subversion/servers文件中: – (更改为)

 [global] # http-proxy-exceptions = *.exception.com, www.internal-site.org # http-proxy-host = defaultproxy.whatever.com # http-proxy-port = 7000 # http-proxy-username = defaultusername # http-proxy-password = defaultpassword # http-compression = no # No http-timeout, so just use the builtin default. # No neon-debug-mask, so neon debugging is disabled. # ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem # # Password / passphrase caching parameters: store-passwords = yes store-ssl-client-cert-pp = yes # store-plaintext-passwords = no # store-ssl-client-cert-pp-plaintext = no