如何安全地保存git凭证

如何安全地保存git凭证

本文介绍了如何安全地保存git凭证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在寻找一个关于如何在 CentOS 7 中安全保存git证书的解决方案。我想保存证书对于多个git存储库。



我提出的解决方案是使用 gnome-keyring 以及任何版本的git。但我遇到了一些问题。我发现很多帖子称它在 Redhat 7 Centos 7 中不是一个好的解决方案。它将被弃用。

  git config --global credential.helper / usr / share / doc / git / contrib / credential / gnome-keyring / git-credential -gnome -keyrin 

但是这对我并不适用,使用git时出错:

然后我升级了git的最新版本 2.11 + 以使用libsecret,这似乎更容易使用。



  git config  - 全局凭证.helper / usr / share / doc / git / contrib /凭证/ libsecret / git-credential -libsecret 

这似乎按预期工作。我的问题是这是一个很好的解决方案来安全地保存git凭证?你知道任何其他的解决方案来保存在CentOS机器上的git证书吗?

解决方案

是的,正如我在。

libsecret实现。


这是目前使用的官方图书馆。






更新Git 2.15.x / 2.16(Q1 2018),其中 libsecret 的凭证助手(位于 $ contrib / )已被改进,以允许可能提示最终用户解锁当前被锁定的秘密(否则秘密可能不会被加载)。



请参阅(2017年11月3日)由。


I've been recently looking for a solution on how to securely save git credentials in CentOS 7.

I want to save credentials for multiple git repositories.

The solution that I come up with is to use gnome-keyring with any version of git. but I was experiencing some issues with it. and I found many posts saying it's not a good a solution in Redhat 7 or Centos 7. and It will be deprecated.

git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyrin

But this didn't work for me, an error when using git :

then I upgraded git the last version 2.11+ to use libsecret which seems to be more easy to use.

I have done the same thing.

git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

And this seems to work as expected. my Question is this is a good solution to securely save git credentials ? Do you know any other solution to save git credentials on a CentOS machine?

解决方案

Yes, as I documented in "Error when using Git credential helper with gnome-keyring as Sudo".
libsecret implements XDG Secret Service API.

It is the current official library to use.


Update Git 2.15.x/2.16 (Q1 2018), where the credential helper for libsecret (in contrib/) has been improved to allow possibly prompting the end user to unlock secrets that are currently locked (otherwise the secrets may not be loaded).

See commit 9c109e9 (03 Nov 2017) by Dennis Kaarsemaker (seveas).

这篇关于如何安全地保存git凭证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 08:07