macos Mac 上的 Subversion - 拒绝从钥匙串获取密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/661923/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Subversion on Mac - refuses to get password from keychain
提问by Andy Baker
On Mac OS X Leopard - when I try and access a remote repository from Terminal it always asks for: 1. Password 2. Username 3. Password (again)
在 Mac OS X Leopard 上 - 当我尝试从终端访问远程存储库时,它总是要求:1. 密码 2. 用户名 3. 密码(再次)
with the message: "Authentication realm: http://svn.myserver.com:80Subversion"
带有消息:“身份验证领域:http://svn.myserver.com: 80Subversion”
I've checked and my credentials are being stored in Keychain and SVN has access to them. Why won't it use them?
我已经检查过,我的凭据存储在钥匙串中,SVN 可以访问它们。为什么不使用它们?
回答by tixastronauta
I got this solved by recursively changing the owner of the subversion authentication directory:
我通过递归更改 subversion 身份验证目录的所有者解决了这个问题:
sudo chown -R myuser:staff ~/.subversion/auth/
sudo chown -R myuser:staff ~/.subversion/auth/
(previous user:grouppair was set to root:staff
)
(以前的用户:组对设置为root:staff
)
You also need to set password-stores = keychain
on subversion configuration file:
您还需要password-stores = keychain
在 subversion 配置文件上进行设置:
~/.subversion/config
~/.subversion/config
回答by Barry Wark
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
(和大多数 Unix 应用程序)将您的本地用户名作为远程登录的用户名传递。我怀疑您在 Subversion 服务器上的帐户名与您的本地帐户名不同。因此,当您第一次输入 Subversion 密码时,身份验证会失败,并且svn
像大多数 Unix 应用程序一样,然后会询问远程用户名和密码并尝试重新进行身份验证。您可以使用以下--username
选项传递远程用户名svn
:
svn --username [remote_username] ...
回答by user132837
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.
我通过删除相应的身份验证文件解决了这个问题~/.subversion/auth/svn.simple
(用 grep 找到正确的文件,因为它们被命名为有趣的)。然后在该存储库中的下一个 svn 之后(其中 svn 询问用户名和密码)它现在可以正常工作。
回答by user1498782
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.
从 ssh 窗口运行 svn 命令时遇到了同样的问题。根据上面的一些评论,我删除了 ~/.subversion/auth/svn.simple 下的关联文件,然后直接在 OSX 框上从终端会话运行我的 svn 命令,这会弹出一个窗口询问我是否要授予以下权限svn 读取我的钥匙串。我永远授予它权限,现在我的 ssh 窗口中的 svn 命令可以正常工作,而不会提示我输入密码。
回答by tarpaha
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"
- 取消注释
password-stores = keychain
中~/.subversion/config
- 结帐/更新您的存储库,输入凭据。
- 打开钥匙串应用程序,在登录钥匙串中找到包含存储库地址的行,双击它(或每个),选择访问控制选项卡,然后选中“允许所有应用程序访问此项目”
After that subversion finally remember my credentials.
在那次颠覆之后终于记住了我的凭据。
Btw this problem began when I switched from default terminal to iTerm2 + zsh + oh my zsh
顺便说一句,当我从默认终端切换到 iTerm2 + zsh + oh my zsh 时,这个问题就开始了
回答by 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.
我在 OS X 中遇到了类似的问题,其中 SVN 只是拒绝使用我存储的凭据,尽管它们在钥匙串中明确注册并授予 svn 访问权限。
Turns out my ~/.subversion/auth
directory had odd permissions.
原来我的~/.subversion/auth
目录有奇怪的权限。
sudo chmod 777 ~/.subversion/auth
resolved my issue.
sudo chmod 777 ~/.subversion/auth
解决了我的问题。
回答by Jeremy Whitlock
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.
你能提供更多信息吗?直到 Subversion 1.4.x 才添加密码的钥匙串缓存。你有任何错误吗?我们需要更多信息来提供帮助。
回答by Matt Connolly
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.
我没有答案,但我注意到如果我在本地登录到我的机器,那么 subversion 将读取钥匙串密码,但是如果我从删除机器上 ssh 进入 mac,那么 subversion 将不会读取钥匙串密码.
Seems that the ssh login puts the svn command in an environment which does not have access to the keychain...
似乎 ssh 登录将 svn 命令置于无法访问钥匙串的环境中...
Could that be your issue?
那会是你的问题吗?