gr4*_*t3d 41 encryption version-control git
嗨,我想用 git 保存数据,加密(在某些平台上,如bitbucket或github)。因此问题:
我正在寻找不同的轻松方式:
如何在 bitbucket (/github)上设置加密存储库?现在,我是 git 的新手,因此非常感谢包含所有必要步骤或分步说明的说明!
git-crypt
我找到了git-crypt,但在网站上提到它用于单个文件加密。如果有人想加密整个存储库,他们会将其转发到git-remote-gcrypt。
git-remote-gcrypt
在他们的README.rst 中,他们把它写得很简单
快速开始
git remote add cryptremote gcrypt::rsync://example.com:repo
git push cryptremote master
> gcrypt: Setting up new repository
> gcrypt: Remote ID is :id:7VigUnLVYVtZx8oir34R
> [ more lines .. ]
> To gcrypt::[...]
> * [new branch] master -> master
Run Code Online (Sandbox Code Playgroud)
或低于
例子
# notice that the target git repo must already exist and its
# `next` branch will be overwritten!
git remote add gitcrypt gcrypt::git@example.com:repo#next
git push gitcrypt master
Run Code Online (Sandbox Code Playgroud)
我更喜欢完整的存储库加密,因此我尝试git-remote-gcrypt了Quickstart和Example 的变体。到目前为止,我尝试按照他们的说明推送现有存储库。这产生了:(注意:我故意将用户名更改为user)
-> 与ssh提供的示例一样
[...]/git_test$ git remote add origin gcrypt::git@bitbucket.org:user/test.git
[...]/git_test$ git push -u origin --allgcrypt: Development version -- Repository format MAY CHANGE
gcrypt: Repository not found: git@bitbucket.org:user/test.git
gcrypt: Setting up new repository
gcrypt: Remote ID is :id: ...
Zähle Objekte: 10, Fertig.
Komprimiere Objekte: 100% (6/6), Fertig.
Total 10 (delta 0), reused 0 (delta 0)
gcrypt: Encrypting to: --throw-keyids --default-recipient-self
gcrypt: Requesting manifest signature
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Fehler beim Versenden einiger Referenzen nach 'gcrypt::git@bitbucket.org:user/test.git'
Run Code Online (Sandbox Code Playgroud)
或与https(有效)
[...]/git_test$ git remote add gitcrypt gcrypt::https://user@bitbucket.org/user/test.git
[...]/git_test$ git push -u gitcrypt --allgcrypt: Development version -- Repository format MAY CHANGE
Password for 'https://user@bitbucket.org':
gcrypt: Repository not found: https://user@bitbucket.org/user/test.git
gcrypt: Setting up new repository
Password for 'https://user@bitbucket.org':
gcrypt: Remote ID is :id: ...
Zähle Objekte: 10, Fertig.
Komprimiere Objekte: 100% (6/6), Fertig.
Total 10 (delta 0), reused 0 (delta 0)
gcrypt: Encrypting to: --throw-keyids --default-recipient-self
gcrypt: Requesting manifest signature
Password for 'https://user@bitbucket.org':
To gcrypt::https://user@bitbucket.org/user/test.git
* [new branch] master -> master
Branch master konfiguriert zum Folgen von Remote-Branch master von gitcrypt.
Run Code Online (Sandbox Code Playgroud)
尽管如此,我还是不明白如何添加用户,甚至只是将我的备份拉到另一台机器上(因为我的 gpg 密钥是在本地生成的)!?请随意回答git-remote-gcrypt.
har*_*ymc 21
一个免费且部分开源的工具是 Keybase:
Git 支持远程助手。我们已经做了一个开源的。
Keybase 的远程助手执行所有加密,同时让 git 做它的事情。这听起来可能令人印象深刻,但 Keybase 并没有从头开始重新实现 git。我们提供了一个远程助手,由我们已经开始贡献的优秀 go-git 项目提供支持。
我们提出:(1) 加密,(2) 团队 + 多设备密钥管理,(3) 更安全的身份概念。
它是端到端加密的。它是托管的,比如 GitHub,但只有你(和队友)可以解密其中的任何一个。对于 Keybase 来说,一切都不过是一团乱码。对您而言,这是常规结账,无需额外步骤。
甚至您的存储库名称和分支名称也是加密的,因此 Keybase 员工或渗透者无法读取。
通过Keybase Teams支持团队合作 :
Keybase 团队是一组具有灵活成员资格的命名人员。假设您从事一个名为 Treehouse 的项目。您可以在 Keybase 上注册树屋。这个队名是通用的;只能有一个具有给定名称的 Keybase 团队。
团队获得聊天和频道。聊天看起来有点像 Slack 或 Discord:
但是 Keybase 团队合作是端到端加密的,这意味着您不必担心服务器被黑客攻击。
小智 6
使用 git-remote-gcrypt 和 Bitbucket 的分步说明:
\n\nbrew install gpg在 macOS 上)brew install git-remote-gcrypt在 macOS 上)本指南将引导您完成使用 Bitbucket 创建和使用名为 \xe2\x80\x9cgcrypt-sample\xe2\x80\x9d 的 git 存储库的过程,利用 git-remote-crypt 和专用 PGP 密钥对来提供最终-端到端加密。
\n\n每一次推动都将是一次强力推动!
\n\ngit init gcrypt-samplegcrpyt-samplessh-keygengit remote add cryptremote gcrypt::git@bitbucket.org:user/gcrypt-sample.gitgpg --gen-key即可。git config remote.cryptremote.gcrypt-participants <GPG key fingerprint>git config remote.cryptremote.gcrypt-signingkey <GPG key fingerprint>echo \'Hello, world!\' > hello.txtgit add hello.txtgit commitgit push -u cryptremote master\n\n每次下拉(包括推入)时,您都必须循环浏览 PGP 密钥,直到找到正确的密钥。原因是 git-remote-gcrypt 默认使用隐私保护来编辑签名密钥的身份。因此,从存储库中提取时,您必须检查所有可用密钥以查看哪一个是签名密钥。remote.cryptremote.gcrypt-publish-participants可以通过设置属性(任何内容)来发布所使用的签名密钥(并因此撤销匿名性) 。
如果您为存储库设置了显式且单一的 PGP 密钥,那么这样做应该没问题。然而,这样做确实会对共享存储库产生影响(不同的提交无疑可以与不同的用户绑定)。
\n\n在我的肉眼看来,几乎一切。
\n\n| 归档时间: |
|
| 查看次数: |
18610 次 |
| 最近记录: |