git 如何通过 Tor 匿名在 github 上贡献?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10274879/
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
How to contribute on github anonymously via Tor?
提问by Greg Manitoba
I would like to contribute anonymously to projects on github. Not to cause mischief, more in the spirit of anonymous donations.
我想匿名为 github 上的项目做出贡献。不引起恶作剧,更多的是本着匿名捐赠的精神。
The tool of choice for being anonymous online seems to be TOR, which works well for almost anything you can do in a browser. However, to contribute on github, it appears necessary to use the command line interface, or the Mac app.
在线匿名的首选工具似乎是 TOR,它几乎适用于您可以在浏览器中执行的任何操作。但是,要在 github 上做出贡献,似乎需要使用命令行界面或 Mac 应用程序。
How can I channel my git operations in this setup through Tor? And how can I verify that this is actually what is happening?
如何通过 Tor 在此设置中引导我的 git 操作?我如何才能验证这确实是正在发生的事情?
Edit:please note the difference between pseudonymous(with a fake e-mail address) and anonymous(with an IP address that cannot be associated with an identity). Pseudonymous access to github is trivial; however, I am looking for anonymous access.
编辑:请注意假名(使用假电子邮件地址)和匿名(使用无法与身份关联的 IP 地址)之间的区别。对 github 的匿名访问是微不足道的;但是,我正在寻找匿名访问。
回答by Wander Nauta
Have you considered going the old-fashioned 'mail them a patch' route? You could simply check out the repository (using Tor and Git-over-HTTPS if you want), make your improvements, then do a git diff
and send the project owners the patch using any anonymous messaging service. Freenet and postal mail come to mind.
你有没有考虑过老式的“给他们邮寄补丁”的路线?您可以简单地查看存储库(如果需要,可以使用 Tor 和 Git-over-HTTPS),进行改进,然后git diff
使用任何匿名消息服务将补丁发送给项目所有者。Freenet 和邮政邮件浮现在脑海中。
Note that if I were the owner of a large(ish) project, I would never everaccept a patch from an anonymous entity, for a few reasons. Even if the person in question isn't necessarily nefarious, having code in the system that nobody is responsible for is a scary thought at best. Also, think about code ownership and copyright troubles.
请注意,如果我是一个大型(ish)项目的所有者,出于一些原因,我永远不会接受来自匿名实体的补丁。即使有问题的人不一定是邪恶的,但系统中没有人负责的代码充其量只是一个可怕的想法。另外,请考虑代码所有权和版权问题。
回答by SpliFF
Before Tor there were cyber-cafes and wi-fi hotspots. Just because there's an IP associated with your commits doesn't mean it has to be yours.
在 Tor 之前,有网吧和 Wi-Fi 热点。仅仅因为有一个与您的提交相关联的 IP 并不意味着它必须是您的。
回答by anonotree
None of these answers give a full useable workflow, I want to git push
, not send an email! Here's how to do it properly but there's a bit of setup required. Instructions are for OSX
这些答案都没有给出完整可用的工作流程,我想git push
,而不是发送电子邮件!以下是如何正确执行此操作,但需要进行一些设置。说明适用于 OSX
Publishing anonymously to github with tor+ssh
使用 tor+ssh 匿名发布到 github
Download tor browser bundle AND the tor command line proxy
brew install tor brew cask install torbrowser
1.1 In tor browser, Create a new email address ( I used hmamail).
1.2 In tor browser, Create a new github account
Create a new ssh key, only for tor with your new email address
ssh-keygen -t rsa -b 4096 -C "[email protected]"
2.1. Give it a name like:
~/.ssh/private_tor_rsa
2.2. In github, go to SSH and PGP keysand add a new SSHkey, make title memorable.
2.3. In github, set Keyto the public key you've just created
clip < ~/.ssh/private_tor_rsa.pub
In github, create an empty repository, let's call it
ByteCoin
, don't initialise it with a readme.Edit the ssh config file
~/.ssh/config
(create if it doesn't exist)Host github-tor-alias User git HostName github.com IdentitiesOnly yes IdentityFile ~/.ssh/tor_only_rsa ProxyCommand nc -X 5 -x 127.0.0.1:9050 %h %p
You've created a hostname called
github-tor-alias
and tells ssh to use a proxy onlocalhost:9050
and use thetor_only_rsa
key to authenticate.Setup the config for your new project to use the tor proxy and credentials.
mkdir secret-project cd secret-project git init git config --add user.name satoshi_2 git config --add user.email [email protected]
下载 tor 浏览器包和 tor 命令行代理
brew install tor brew cask install torbrowser
1.1 在 Tor 浏览器中,创建一个新的电子邮件地址(我使用的是 hmamail)。
1.2 在tor浏览器中,新建一个github账号
创建一个新的 ssh 密钥,仅适用于使用新电子邮件地址的 Tor
ssh-keygen -t rsa -b 4096 -C "[email protected]"
2.1. 给它一个名字,如:
~/.ssh/private_tor_rsa
2.2. 在 github 中,转到SSH 和 PGP 密钥并添加一个新的SSH密钥,使标题令人难忘。
2.3. 在github中,设置Key为你刚刚创建的公钥
clip < ~/.ssh/private_tor_rsa.pub
在github中,创建一个空的存储库,我们称之为
ByteCoin
,不要用自述文件初始化它。编辑 ssh 配置文件
~/.ssh/config
(如果不存在则创建)Host github-tor-alias User git HostName github.com IdentitiesOnly yes IdentityFile ~/.ssh/tor_only_rsa ProxyCommand nc -X 5 -x 127.0.0.1:9050 %h %p
您已经创建了一个名为的主机名,
github-tor-alias
并告诉 ssh 使用代理localhost:9050
并使用tor_only_rsa
密钥进行身份验证。为您的新项目设置配置以使用 Tor 代理和凭据。
mkdir secret-project cd secret-project git init git config --add user.name satoshi_2 git config --add user.email [email protected]
This next line is bloody important
下一行非常重要
5.1. note the ssh://gitand github-tor-alias
5.1. 注意ssh://git和github-tor-alias
git remote add origin ssh://git@github-tor-alias/staoshi_2/ByteCoin.git
Remember how you installed the torcommand line proxy? start it as a service. It listens on localhost:9050
brew services start tor
Are you ready? Try pushing to github:
git push origin master
还记得你是如何安装Tor命令行代理的吗?将其作为服务启动。它在 localhost:9050 上侦听
brew services start tor
你准备好了吗?尝试推送到github:
git push origin master
Did it work? Go and double check everything, have I missed something? please edit this answer!
它起作用了吗?去仔细检查一切,我错过了什么吗?请编辑此答案!
Congratulations
恭喜
breath that free air and get creating!
呼吸自由空气并开始创作!
So what have we just done? we've created a new identity who is associated only with the tor network, as far as github.com is concerned, you are staoshi_2 and could be anywhere in the world.
那么我们刚刚做了什么?我们创建了一个新的身份,只与 tor 网络相关联,就 github.com 而言,你是 staoshi_2,可以在世界任何地方。
tor runs a proxy on 127.0.0.1:9050
, because we setup a ProxyCommand
in the ~/.ssh/config
file, all of your traffic goes through the tor proxy, git uses your new ssh key because you added IdentityFile
and IdentitiesOnly
to your ~/.ssh/config
file.
tor 在 上运行代理127.0.0.1:9050
,因为我们ProxyCommand
在~/.ssh/config
文件中设置了 a ,您的所有流量都通过 tor 代理,git 使用您的新 ssh 密钥,因为您添加了IdentityFile
和IdentitiesOnly
到您的~/.ssh/config
文件。
Powerful stuff.
强大的东西。
Let's double check that you're really anonymous
让我们仔细检查一下你是否真的是匿名的
stop
tor
and try togit push
again, it had better fail!ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository.
8.1. If that git push succeeded well guess what, you weren't using tor, github.com knows your IP, figure out how to get it working and then start again with a new email address.
停下来
tor
再试git push
一次,最好还是失败!ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository.
8.1. 如果那个 git push 成功了,你猜怎么着,你没有使用 Tor,github.com 知道你的 IP,弄清楚如何让它工作,然后用一个新的电子邮件地址重新开始。
9. Happy freedom!
9. 快乐的自由!
anon.
匿名
回答by CQM
Configure git proxy server Getting git to work with a proxy server
配置 git 代理服务器让 git 与代理服务器一起工作
or if this doesn't work with the TOR network, then simply run your git
command in a virtual machine where the host machine is using the TOR network to connect to the outside world
或者,如果这不适用于 TOR 网络,则只需git
在主机使用 TOR 网络连接到外部世界的虚拟机中运行您的命令
I assume this will obfuscate the origin of your commit, but the anonymous email part may still be difficult.
我认为这会混淆您提交的来源,但匿名电子邮件部分可能仍然很困难。
Anonymous email providers come and go, but as of 2015 Lelantos is currently a TOR hidden service that offers clearnet email addresses. Payable in Bitcoin but you can anonymize all bitcoin transactions using http://www.xmr.towhich lets you pay bitcoin receipts using the more private Monero network.
匿名电子邮件提供商来来去去,但截至 2015 年,Lelantos 目前是 TOR 隐藏服务,提供 clearnet 电子邮件地址。可以用比特币支付,但您可以使用http://www.xmr.to匿名化所有比特币交易,这让您可以使用更私密的 Monero 网络支付比特币收据。
Why not simply do a pseudonymous email that you also create while in TOR, never access it from outside of TOR, and use that for github compliance
为什么不简单地做一个你也在 TOR 中创建的匿名电子邮件,永远不要从 TOR 外部访问它,并将其用于 github 合规性
回答by A T
You could try using the Cloud 9 IDE
您可以尝试使用Cloud 9 IDE
Access it via Tor, create new Github and Bitbucket accounts.
通过 Tor 访问它,创建新的 Github 和 Bitbucket 帐户。
Fork whichever project you want to contribute to, make your changes, send the pull request or patch
Fork 你想贡献的任何项目,进行更改,发送拉取请求或补丁
win
赢
回答by John destiny
Most of the answers in this thread do not go about replying question asked.
该线程中的大多数答案都不会回答所提出的问题。
You asked: Is it possible to use all applications of my operating system through tor, so as to make anonymous contributions. It might be necessary to do so in occasions where contributing to software projects puts you in legal risks (e.g. contributing to cryptography libraries where cryptography is illegal.)
你问:是否可以通过tor使用我操作系统的所有应用程序,从而进行匿名贡献。在为软件项目做出贡献会使您面临法律风险的情况下,可能有必要这样做(例如,为密码学非法的密码学库做出贡献。)
You have been suggested to use postal mail (currently the most popular answer?), to go to the cyber-cafe next to your home, which very probably has a camera, and to use very brittle configurations which put you at risk. Some answers are outright stupid, and some others are valid enough, though they require everything to be setup perfectly to work.
有人建议您使用邮政邮件(目前最受欢迎的答案?),去您家旁边的网吧,那里很可能有一个摄像头,并使用非常脆弱的配置,这使您处于危险之中。有些答案是彻头彻尾的愚蠢,而另一些答案则足够有效,尽管它们需要一切设置完美才能工作。
It may happen that you (or some software you install) accidentally misindents or breaks a configuration file, causing your connections to go to github in the clear. Furthermore, it is possible that an ISP level attacker see which packages you are installing for development, and he is able to identify what sort of project you are working on.
可能会发生您(或您安装的某些软件)不小心误读或破坏了配置文件,导致您的连接无缘无故地转到 github 的情况。此外,ISP 级别的攻击者可能会看到您正在为开发安装哪些软件包,并且他能够识别您正在从事的项目类型。
This is in most cases, unacceptable. For me, and my current setup, it is necessary that:
这在大多数情况下是不可接受的。对于我和我目前的设置,有必要:
- All connections to Github are guaranteed to go through TOR.
- All non-tor connections are dropped, and all DNS goes through TOR.
- All TCP traffic from your machine is routed through tor. This includes apt-get, all the connections your IDE makes, everything.
- 所有与 Github 的连接都保证通过 TOR。
- 所有非 Tor 连接都被丢弃,所有 DNS 都通过 TOR。
- 来自您机器的所有 TCP 流量都通过 tor 路由。这包括 apt-get,您的 IDE 建立的所有连接,一切。
This is very complex and is far out of my league. Luckily, there are distros which allow for this kind of thing, such as Tailsor Whonix. There is another distro, Attack Vector, which might come with development tools, but is not as proven.
这是非常复杂的,并且在我的范围之外。幸运的是,有些发行版允许这种事情,例如Tails或Whonix。还有另一个发行版,Attack Vector,它可能随开发工具一起提供,但还没有经过验证。
After installing one of these, you will be able to access github's interface through tor browser, and you will be able to commit either through SSH or HTTPS, whatever your preference, without special configuration.
安装其中之一后,您将能够通过 Tor 浏览器访问 github 的界面,并且您将能够通过 SSH 或 HTTPS 提交,无论您喜欢什么,无需特殊配置。
I would suggest Whonix, since it's easier to persist data you need to work, and guarantees a root level compromise on the main machine does not compromise your identity.
我建议使用 Whonix,因为它更容易保存您需要工作的数据,并保证主机上的根级别妥协不会损害您的身份。
回答by iase
In Linux:
在 Linux 中:
Install tor and head over to http://tormail.org/to get yourself an anonymous email account.
安装 tor 并前往http://tormail.org/获得一个匿名电子邮件帐户。
Make yourself a new linux user on your local machine and generate a new ssh key for that user so that your anon account does not have the same public key as your other github accounts :-) You'll do all your anon work through this user account
在本地机器上让自己成为一个新的 linux 用户,并为该用户生成一个新的 ssh 密钥,以便您的 anon 帐户与您的其他 github 帐户没有相同的公钥 :-) 您将通过该用户完成所有 anon 工作帐户
Next sign up to github w/ your tormail email and install the public ssh key you just generated
接下来使用您的 tormail 电子邮件注册 github 并安装您刚刚生成的公共 ssh 密钥
Now install socat http://freecode.com/projects/socat. But you'll probably find it in your distro's package manager.
现在安装 socat http://freecode.com/projects/socat。但是您可能会在发行版的包管理器中找到它。
Now edit /etc/ssh/ssh_config and add
现在编辑 /etc/ssh/ssh_config 并添加
HOST *
ProxyCommand socat STDIO SOCKS4A:127.0.0.1:%h:%p,socksport=9050
Make sure that your tor is configured to use port 9050. You should see this in your torrc file:
确保您的 tor 配置为使用端口 9050。您应该在 torrc 文件中看到:
SocksListenAddress 127.0.0.1
SocksPort 9050
Now ALL your SSH is going to go through TOR, including any github access through the ssh protocol. so use the ssh protocol to do the clone: git clone [email protected]:bitcoin/bitcoin.git
现在您所有的 SSH 都将通过 TOR,包括通过 ssh 协议进行的任何 github 访问。所以使用 ssh 协议进行克隆: git clone [email protected]:bitcoin/bitcoin.git
use wireshark to verify that nothing goes direct to github.
使用wireshark 验证没有任何内容直接发送到github。
回答by user1338062
You could commit locally on a clone of the project, and then use git format-patch
to send the commits via e-mail.
您可以在项目的克隆上本地提交,然后用于git format-patch
通过电子邮件发送提交。
回答by Aleksejs Popovs
You can use tsocks
or torify
to make any application work through Tor.
您可以使用tsocks
或torify
使任何应用程序通过 Tor 工作。
回答by LotoLo
Another simple solution:
另一个简单的解决方案:
$ git remote add tor https://github.com/yourUser/yourProject
$ torsocks git pull tor
$ torsocks git push tor
You obviously need to remember to put tor
postfix in your git commands, or maybe you can configure aliases:
您显然需要记住将tor
postfix 放在您的 git 命令中,或者您可以配置别名:
$ alias gpushtor="torsocks git push tor"
$ alias gpulltor="torsocks git pull tor"
(Note: it will only work with https://
remotes)
(注意:它只适用于https://
遥控器)