我按照书上的指示做了一切,即从.subversion/auth中删除了身份验证文件,并明确将相关配置参数设置为'yes',尽管这是默认的,但每次使用shell SVN命令时都会要求输入密码。仓库位于cvsdude.com上,客户端运行Linux操作系统。 我还使用缓存密码良好的Subclipse插件。
我模糊地记得当我开始使用它时,该命令会交互地问我是否要保存明文密码,而我选择了不保存。这个选择能否被存储在某个地方,并优先于配置文件?
我按照书上的指示做了一切,即从.subversion/auth中删除了身份验证文件,并明确将相关配置参数设置为'yes',尽管这是默认的,但每次使用shell SVN命令时都会要求输入密码。仓库位于cvsdude.com上,客户端运行Linux操作系统。 我还使用缓存密码良好的Subclipse插件。
我模糊地记得当我开始使用它时,该命令会交互地问我是否要保存明文密码,而我选择了不保存。这个选择能否被存储在某个地方,并优先于配置文件?
最近版本的Subversion(~ 1.8)允许您通过$HOME/.subversion/servers
配置密码缓存:
[global]
store-passwords = yes
store-plaintext-passwords = yes
但是,根据您的系统设置,这可能还不够。如果不够,请确保$HOME/.subversion/config
包含以下内容:
[auth]
password-stores =
password-stores =
行必须放在 [auth]
部分中。 - Thomas Leonard$HOME/.subversion/config
和 $HOME/.subversion/servers
)。对我来说很管用(Oxygen 3 - Mars 2018),非常感谢我的朋友! - Nicopassword-stores =
行将不再起作用(例如,您需要启动一个 gpg-agent --daemon
进程并配置 SVN,如 password-stores = gpg-agent
)。请参阅 https://subversion.apache.org/docs/release-notes/1.12#client-server-improvements "On Unix-like systems, client-side storage of passwords in plaintext on disk is now disabled by default at compile-time."。 - SRG我相信我尝试了一切:
[global]
和[groups]
部分中都进行了设置对于所有的配置文件,我验证了所有的部分,并输入了一个错误参数来验证svn客户端停止工作(所以,配置文件已经被读取)。
检查$HOME/.subversion/config
中的客户端配置是否禁用了密码存储:
[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.
# password-stores = gpg-agent,gnome-keyring,kwallet
### To disable all password stores, use an empty list:
password-stores =
### 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 # just in case
store-auth-creds = yes # just in case
什么都没用。
然后我阅读了精细的手册。一切都很好: 你不必能够做到这一点。“在Unix系统上,默认情况下禁止将密码以明文形式存储在磁盘上”。
幸运的是,读取密码的部分仍然存在于客户端二进制文件中。因此,如果密码恰好被存储了,它将起作用。我正在运行SVN 1.13:
svn, version 1.13.0 (r1867053)
compiled Mar 24 2020, 12:33:36 on x86_64-pc-linux-gnu
~/.subversion/auth/svn.simple
目录中创建的文件(它可能包含多个文件,你可能需要检查它们以找到你想要的领域),并找到了以下内容:K 15
svn:realmstring
V 37
<svn://home.sweet.home:3690> Profekto
K 8
username
V 6
lserni
END
K 8
passtype
V 6
simple
K 8
password
V 20
NotTheActualPassword
~/.subversion/auth/svn.simple
中可能会有多个文件。 - wolfrevo在类 Unix 系统中,默认情况下禁用客户端明文密码存储,建议使用基于 Gnome Keyring、Kwallet 或 GPG-Agent 的密码缓存机制。
这个变更不影响 Windows 和 Mac OS 平台,因为它们一直以来都使用加密格式存储密码。
所以... 除非你自己编译了 SVN 客户端,否则你现在很可能有一个不允许存储明文密码的版本。
顺便说一下,之前能够正常工作的明文密码在升级 Subversion 后甚至可能停止工作。
如果你不介意每次会话都输入密码,使用 gpg-agent
相当简单。只需运行 gpg-agent --daemon
,然后运行 svn 命令输入密码,下一个命令将不再需要它。
如果有助于未来某个人,我希望提交详细的答案。
Subversion 1.6及更高版本默认会缓存您的用户名和密码,但除非您通过命令行或更改Subversion配置明确允许,否则它不会以明文方式缓存密码。
如果您使用--username和--password选项签出了工作副本,则会看到以下消息:
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<https://subversion.assembla.com:443> Assembla Restricted Area
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'~/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)?
正如消息中提到的那样,如果您输入“是”,Subversion才会保存未加密的密码。 如果这样做,您将来执行svn命令时无需添加--username或--password选项。
但是,如果您不希望看到此提示,您可以通过更改本地计算机上名为“server”的配置文件来更改Subversion客户端的全局配置。 它存储在这里:
~/.subversion/server
您需要将以下行添加到“服务器”文件中:[global]
store-plaintext-passwords = yes
随着这个改变,您只需要使用 --username 和 --password 选项执行一次 svn 命令。然后,Subversion 将自动保存您的凭据,而不会出现上述提示。
有关禁用此警告并在纯文本中缓存密码的更多信息,请参阅Subversion 1.6 安全改进 博客文章。
我遇到了同样的问题,认为我在.subversion/servers和.subversion/config中设置了所有适当的配置,尝试删除.subversion/auth等,但都没有成功。
最终我通过移动.subversion目录(或删除它也可以)并运行svn co来保存凭据。我收到了以下消息:
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<http://sweeney:80> Subversion repository
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/davids/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)?
我输入了“yes”,然后得到了同样的消息。我顽固地再次输入了“yes”。现在我的密码似乎已经保存了。
有点出乎意料的是,在.subversion中查看配置时,没有一个设置被取消注释;它们都设置为默认值,因此我想未来要为不同的服务器保存密码,我需要两次回答这个警告。
希望这可以帮到你。
~/.subversion/auth/svn.simple/
缓存文件中。~/.subversion/config
([auth] 部分):password-stores=
< p >(请考虑:空值!这可以防止客户选择任何错误的东西并假设“简单”。)< /p >
< p >现在例如尝试一个:< /p >
svn up
Subversion现在会警告您保存纯文本密码。
如果您对此没有问题,请输入“是”,一切都没问题了。
之后,Subversion将为特定服务器创建缓存文件,然后您可以再次删除“password-stores”的条目。
删除旧的存储密码,例如rm ~/.subversion/auth/svn.simple/*。我尝试了所有其他建议,这是对我有效的方法。
无论我做了什么都没有用。我检查了所有可能的选项、配置文件以及谷歌上关于这个问题的数百页。最终,我放弃了,并将这个命令添加到了我的 .bashrc 文件中。
alias svn='svn --password <mypassword>'
[auth]
部分会存在这种冗余。在谈论存储密码时,SVN 书籍也没有提到这一点。我需要对服务器文件进行两处更改才能使其对我起作用
# Password / passphrase caching parameters:
store-passwords = yes
store-plaintext-passwords = yes
svn
吗? - ZoogieZorksvn+ssh://
登录? - Sander Rijken~/.subversion/config
和~/.subversion/servers
文件内容? 只需要从config
中的[auth]
部分和servers
中的[global]
即可。 - ZoogieZork'store-passwords' 和 'store-auth-creds' 现在都可以在您的配置目录下的 'servers' 文件中指定。
在此部分中指定的任何内容都将被 'servers' 文件中指定的设置覆盖。
- Hoàng Long