什么是Linux上最好的加密git凭证帮助程序? [英] What's the best encrypted git credential helper for Linux?

查看:48
本文介绍了什么是Linux上最好的加密git凭证帮助程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找Linux的良好加密git凭证帮助程序(可以以加密方式存储密码,并在以后检索它们,并遵循git-credential协议的东西),我真的很惊讶没有似乎很多.

I've been looking for a good encrypted git credential helper for Linux (something that can store passwords in an encrypted way, and retrieve them later, conforming to the git-credential protocol), and I'm really surprised that not much seems to be turning up.

在我见过的所有git文档和相关的git-credential文档中,他们甚至都没有提到这种事情的存在.它总是提到Mac的osxkeychain,但是,如果您运行的是Linux,它只会将您重定向到说明如何使用缓存"作为帮助程序的文档.一些参考文献提到了Microsoft用于Windows的git凭据管理器.但是对于Linux没有任何帮助.

In all of the git docs and related git-credential documentation I've seen, they don't even mention the existence of such a thing. It always mentions osxkeychain for Mac, but then if you're running Linux it just redirects you to the doc that explains how to use "cache" as a helper. Some of the references mention Microsoft's git credential manager to use for Windows. But nothing for Linux.

如果您使用实际密码,则使用缓存似乎是一个半好的解决方案.并不可怕,但远非理想.但是,如果您使用的是个人访问令牌(如果要在您的回购帐户上维护2因子安全性,则必须使用该令牌),那么就不行了.无论多么频繁,不得不偶尔输入一次随机生成的PAT都是一个非常糟糕的主意.您不能现实地记住它们,将它们以纯文本格式存储在某个地方会危害安全性.(此外,如果您想自动化一些git操作怎么办?不起作用.)

Using cache seems like a semi-okay solution if you use actual passwords. Not terrible, but far from ideal. But if you're using Personal Access Tokens (which you have to use if you want to maintain 2 Factor security on the account for your repo), then that's a no-go. Having to type in one of those randomly-generated PAT's once in a while, no matter how infrequent, is a really bad idea. You can't realistically memorize them, and storing them somewhere in plain text is a security compromise. (Also, what if you want to automate some git operations? Not going to work.)

那么-这里的解决方案是什么?如果Windows和Mac都存在,那么我敢肯定Linux至少有一个不错的选择,也许很多.例如,我听说您可以使用Gnome做到这一点.但是,如果您没有Gnome,该怎么办?我听说Microsoft的Windows管理器可能在Linux下运行,但尚未尝试过.那是唯一的选择吗?有开源选项吗?

So--what is the solution here? If it exists for both Windows and Mac, I'm sure there is at least one good option for Linux, probably many. I've heard you can do it with Gnome, for instance. But if you don't have Gnome, what should you do? I've heard that Microsoft's manager for Windows may run under Linux, but haven't tried it yet. Is that the only option out there? Is there an open source option?

推荐答案

这是我们在git来源中所拥有的:

This is what we have in git sources: https://github.com/git/git/tree/master/contrib/credential

因此,您可以使用 gnome-keyring (不建议使用), libsecret 或gpg加密的 .netrc .

So you can use gnome-keyring (deprecated), libsecret or gpg-encrypted .netrc.

libsecret 可以在没有GNOME的任何Linux发行版中使用.

libsecret could be used with any Linux distribution without GNOME, I believe.

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

请参见 https://stackoverflow.com/a/40312117/7976758 .

这是使用gpg加密的 .netrc 的方法: https://stackoverflow.com/a/18362082/7976758 .

This is how to use gpg-encrypted .netrc: https://stackoverflow.com/a/18362082/7976758.

这篇关于什么是Linux上最好的加密git凭证帮助程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆