Skip to content

Instantly share code, notes, and snippets.

@tkell
Last active November 22, 2016 00:16
Show Gist options
  • Save tkell/a32128a4695ea3ecb82c74c857a9c941 to your computer and use it in GitHub Desktop.
Save tkell/a32128a4695ea3ecb82c74c857a9c941 to your computer and use it in GitHub Desktop.
Install Tor on AWS, November 2016

As of 2016-11-20, this installs Tor on an AWS Ubuntu Micro EC2 instance

See sources here and here.

Write new apt sources -- you might need to do this manually

echo "deb http://deb.torproject.org/torproject.org xenial main" >> /etc/apt/sources.list
echo "deb-src http://deb.torproject.org/torproject.org xenial main" >> /etc/apt/sources.list

Add the key server

gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -

Install

sudo apt-get update
sudo apt-get install tor deb.torproject.org-keyring

Check that you're running the service

service --status-all | grep tor

Configure

vim /etc/tor/torrc

  • Make sure to open an ORPort that is open in your security policy on AWS
  • Set your contact info, in case things get weird, with ContactInfo
  • Make sure you're not an Exit node, or AWS will get mad: ExitPolicy reject *:* # no exits allowed
  • Make sure to set bandwith limits, with AccoutingMax, AccountingStart, RelayBandwidthRate, and RelayBandwidthBurst

Reload!

sudo service tor reload

Monitor. Wait for the below two lines, then you're good:

tail -F /var/log/tor/log

"Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor." "Performing bandwidth self-test...done."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment