Subversion on Mac - refuses to get password from keychain

徘徊边缘 提交于 2019-11-30 09:36:53

I got this solved by recursively changing the owner of the subversion authentication directory:

sudo chown -R myuser:staff ~/.subversion/auth/

(previous user:group pair was set to root:staff)

You also need to set password-stores = keychain on subversion configuration file:

~/.subversion/config

By default, svn (and most Unix apps) pass your local username as the username for remote login. I suspect that your account name on the Subversion server is different from your local account name. Thus, authentication fails the first time you enter your Subversion password, and svn, like most Unix apps then asks for the remote username and password and attempts to reauthenticate. You can pass your remote user name using the --username option to svn:

svn --username [remote_username] ...

I solved this problem by just removing the corresponding authentication file in ~/.subversion/auth/svn.simple (find the right one with with grep as they're named funny). Then after the next svn up in that repository (where svn asked fro username and password) it is now working correctly.

I ran into the same problem when running svn commands from an ssh window. Based on some comments above I removed the associated file under ~/.subversion/auth/svn.simple and then ran my svn command from a terminal session directly on the OSX box which made a window pop up asking if I wanted to grant permission for svn to read my keychain. I granted it permission forever and now the svn command in my ssh window works without prompting me for my password.

Can you provide more information? Keychain caching of passwords wasn't added until Subversion 1.4.x. Do you get any error? We'll need more information to help.

Nils Rocine

I had a similar issue with OS X in which SVN simply refused to use my stored credentials, despite their clear registration in keychain with access granted to svn.

Turns out my ~/.subversion/auth directory had odd permissions.

sudo chmod 777 ~/.subversion/auth resolved my issue.

I don't have the answer, but I notice that if I'm logged into my machine locally, then subversion will read the keychain password, but if I ssh into the mac from a remove machine, then subversion will not read the keychain password.

Seems that the ssh login puts the svn command in an environment which does not have access to the keychain...

Could that be your issue?

Tried many things from thread, this worked for me:

  • uncomment password-stores = keychain in ~/.subversion/config
  • checkout/update your repo, enter credentials.
  • open keychain app, find line(s) with address of your repository in login keychain, double click it(or each of them), select Access Control tab and and check "Allow all applications to access this item"

After that subversion finally remember my credentials.

Btw this problem began when I switched from default terminal to iTerm2 + zsh + oh my zsh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!