So you're a pseudonymous developer like me. You don't want to leak your real identity through your IP address. You also don't want to rely on shoddy VPN services. What to do? Follow this guide to setup GitHub over Tor-tunneled ssh.
-
Install required software
$ sudo apt-get install netcat tor
-
Create an ssh key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
-
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
-
At the prompt, type a secure passphrase.
-
Add this to your
~/.ssh/config
Host github.com IdentityFile ~/.ssh/github_rsa ProxyCommand nc -X 5 -x localhost:9050 %h %p
This will forward all ssh commands to github.com through your Tor proxy
-
Make sure Tor is off
$ sudo systemctl stop tor
-
Try cloning a repository, ex.
$ git clone git@github.com:fort-nix/nix-bitcoin.git
This should yield a
Cloning into 'nix-bitcoin'... ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
-
Turn on Tor
$ sudo systemctl start tor
-
Clone a repository
$ git clone git@github.com:fort-nix/nix-bitcoin.git
Make sure to always use the ssh variant of GitHub repositories.