Linux 在 svn 中提交文件后如何删除有关存储未加密密码的警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6606782/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:58:18  来源:igfitidea点击:

How to remove warning about storing unencrypted password after committing file in svn

linuxsvnunix

提问by tanmoy

Every time I commit a file in svn I get the following message:

每次我在 svn 中提交文件时,都会收到以下消息:

ATTENTION! Your password for authentication realm:

http://domainname.com:80“domainname.com”

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 '/root/.subversion/servers'.


Store password unencrypted (yes/no)? no

注意力!您的身份验证领域密码:

http://domainname.com:80“域名.com”

只能不加密存储到磁盘!如果可能,建议您配置系统,以便 Subversion 可以加密存储密码。有关详细信息,请参阅文档。您可以通过将“/root/.subversion/servers”中的“store-plaintext-passwords”选项的值设置为“yes”或“no”来避免将来出现此警告。


存储密码未加密(是/否)?不

I don't want this authentication; how can I get rid of this warning?

我不想要这种身份验证;我怎样才能摆脱这个警告?

回答by Stefan

You copied the full warning message here. Reading it instead of just copy/pasting it would answer your question:

您在此处复制了完整的警告消息。阅读它而不是仅仅复制/粘贴它会回答你的问题:

you can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in '/root/.subversion/servers'.

您可以通过将“/root/.subversion/servers”中的“store-plaintext-passwords”选项的值设置为“yes”或“no”来避免将来出现此警告。

回答by derobert

The subversion client is only asking for authentication because the server requires it. To get rid of the authentication requirement, you'll have to change the server's configuration (e.g., in Apache, get rid of AuthType, AuthName, and AuthUserFile). You can use other authentication methods which do not require passwords (for example, client certificates).

Subversion 客户端只要求身份验证,因为服务器需要它。为了摆脱的认证要求,你就必须更改服务器的配置(例如,在Apache中,摆脱AuthTypeAuthNameAuthUserFile)。您可以使用其他不需要密码的身份验证方法(例如,客户端证书)。

If you just want to get rid of the save password unencrypted prompt, you can set store-plaintext-passwords=off(by editing ~/.subversion/config) or you can make encrypted passwords work by getting (on Unices) the GNOME keyring or KDE wallet running. On Windows, SVN should automatically use built-in NTFS encryption; on Mac OS X, the Keyring. See the Client Credentials section of the SVN Manualfor further details.

如果您只想摆脱保存密码未加密提示,您可以设置store-plaintext-passwords=off(通过编辑~/.subversion/config),或者您可以通过(在 Unices 上)运行 GNOME 密钥环或 KDE 钱包来使加密密码起作用。在 Windows 上,SVN 应该自动使用内置的 NTFS 加密;在 Mac OS X 上,钥匙圈。有关更多详细信息,请参阅SVN 手册客户端凭据部分

You could also encrypt your home directory on Unix. Then the credentials would be encrypted as well (but of course available to any program running as you or root while you're logged in, similar to the NTFS encryption).

您还可以在 Unix 上加密您的主目录。然后凭据也将被加密(但当然可以在您登录时以您或 root 身份运行的任何程序使用,类似于 NTFS 加密)。

If you don't want SVN to store passwords at all, encrypted or not, set store-passwords=noin the SVN config file.

如果您根本不希望 SVN 存储密码,无论加密与否,请store-passwords=no在 SVN 配置文件中进行设置。

回答by David W.

You are not storing the password in Subversion because you answered noto the question whether or not you want to store this password.

你是不是在颠覆存储的密码,因为您的回答没有对你是否希望保存此密码的问题。

I take it you want to eliminate this errorwarningmessage entirely. There are two ways to handle that:

我认为您想完全消除此错误警告消息。有两种方法可以处理:

  • The easy, but hard way: You can specify svn --no-auth-cacheeach and every time you a Subversion command. It's easy to do since it requires no real action on your part. It's hard because you have to do this almost every time you use a Subversion command (especially one that touches the repository like checkoutand commit).

  • The hard, but easy way: You can modify your user's Subversion configuration not to ask if you want to store this information. (BTW, why are you running as root? You like living life on the edge? Better off running as a user and configure sudoto allow you to do the root stuff you need. That way, you can track who's doing what, and you don't do something that could accidentally bring the server down. In fact, many Unix/Linux systems by default no longer allow a user to sign in as root. You have to do sudo). This is hard because you have to do something, but easy because once you do it, you don't have to do anything again.

  • 简单但困难的方法:您可以在svn --no-auth-cache每次执行 Subversion 命令时指定。这很容易做到,因为它不需要您采取任何实际行动。这很难,因为几乎每次使用 Subversion 命令时都必须这样做(尤其是像checkout和那样触及存储库的命令commit)。

  • 困难但简单的方法:您可以修改用户的 Subversion 配置,而不是询问您是否要存储此信息。(顺便说一句,你为什么要以root身份运行?你喜欢生活在边缘?最好以用户身份运行并进行配置sudo以允许你做你需要的 root 内容。这样,你可以跟踪谁在做什么,而你不不要做一些可能会意外关闭服务器的事情。事实上,默认情况下,许多 Unix/Linux 系统不再允许用户以 身份登录root。您必须这样做sudo)。这很难,因为你必须做某事,但很容易,因为一旦你做了,你就不必再做任何事情了。

You have the name of the file that you need to edit (/root/.subversion/servers). Look for the [global]section and look for the line # store-passwords = noand remove the #from the beginning of the line. You can also do the same for the # store-plaintext-passwords = noline and the # store-auth-cred = noline. While, you're at it, you can also delete the files under the authdirectory which is where Subversion stores its credentials. This will completely eliminate already stored passwords. More information can be found in the on line Red Bean Subversion manual.

您有需要编辑的文件的名称 ( /root/.subversion/servers)。查找该[global]部分并查找该行# store-passwords = no#从该行的开头删除。你也可以对# store-plaintext-passwords = no线和# store-auth-cred = no线做同样的事情。同时,您还可以删除authSubversion 存储其凭据的目录下的文件。这将完全消除已经存储的密码。更多信息可以在在线Red Bean Subversion 手册中找到

Now, when you do a Subversion command that touches the repository, it'll ask you for a user name and password and won't ask if you want to store them.

现在,当您执行涉及存储库的 Subversion 命令时,它会要求您输入用户名和密码,而不会询问您是否要存储它们。