Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用Git存储密码有多安全?_Linux_Macos_Git_Security - Fatal编程技术网

Linux 使用Git存储密码有多安全?

Linux 使用Git存储密码有多安全?,linux,macos,git,security,Linux,Macos,Git,Security,我在工作场所使用Git,公司政策不允许我以不安全的方式存储密码。有没有比使用git config credential.helper store更好的选项来存储git服务器的密码 p.S.无法使用密钥身份验证,因为这在我们的服务器上是不允许的。git config credential.helper store不是很安全;正如它在书中所说: 使用此帮助程序将未加密的密码存储在磁盘上, 仅受文件系统权限保护 ~/.git凭据文件将设置其文件系统权限,以防止系统上的其他用户读取它,但不会被加密或以其

我在工作场所使用Git,公司政策不允许我以不安全的方式存储密码。有没有比使用
git config credential.helper store
更好的选项来存储git服务器的密码


p.S.无法使用密钥身份验证,因为这在我们的服务器上是不允许的。

git config credential.helper store
不是很安全;正如它在书中所说:

使用此帮助程序将未加密的密码存储在磁盘上, 仅受文件系统权限保护

~/.git凭据文件将设置其文件系统权限,以防止系统上的其他用户读取它,但不会被加密或以其他方式保护

因此,它按原样存储您的密码。Git允许对OSX使用您的keychain
Git config--global credential.helper osxkeychain
,因此看起来更安全。对于您可以使用的Linux系统,它将密码存储在内存中。或者,您也可以按照git help credentials中的说明编写自己的文档:

您可以编写自己的自定义帮助程序,以便与中的任何系统进行交互 你可以保留这些凭证。有关Git的详细信息,请参阅文档 详情

此外,@VonC指向跨平台。另请参见关于.netrc文件


对于Linux,还有一种方法(感谢@jazakmeister的建议)

使用netrc gpg加密凭证帮助程序:。可以在任何平台上工作,Windows、OsX、Linux。还有gnome密钥环助手。我如何在Windows中使用加密存储密码?@testerjoe只要看看上面的评论我在Ubuntu的终端中运行了
git config credential.helper cache
,然后git pull请求凭据。再次运行git pull,未询问凭据。它有效。完全避免使用密码更安全。如果可以,请使用ssh和ssh密钥访问存储库。同意,我将其用于GitHub,但不幸的是,我们的服务器仅使用
https
。我不能改变它,因为它是公司政策(?)。我希望你指的是
https
。问号告诉我你不知道这是否是政策。很多时候,这些东西都不是。即使是这样,政策也可以改变。由你决定是否值得提出建议。