DEV Community

Cover image for How to overcome censorship by using tor system-wide on macOS
Saifur Rahman Mohsin
Saifur Rahman Mohsin

Posted on

How to overcome censorship by using tor system-wide on macOS

Today, I will demonstrate how one can use the tor program as a system-wide proxy on macOS and thereby avoid censorship and gain anonymity.

Step 1: Install tor
You can do this from your Terminal, simply by running

brew install tor
Enter fullscreen mode Exit fullscreen mode

Step 2: Add the custom script to your .bash_profile
You can find the script at my github repo. Copy the 2 functions, and paste it into .bash_profile at the very end.

Step 3: Reset your terminal
For the functions to reload, you have to close and open the terminal app. Once done, you can run starttor and walla, it will start the tor network and show this:
Screenshot 2020-11-07 at 2.43.49 PM

And that's pretty much it. Surf the web anonymously now, and when you're done, go back to the terminal and hit Ctrl+C and it will cancel the tor relay.

Caveat: In case, the tor relay fails to cancel for some reason, the proxy will still be using the tor port and therefore the entire web will be unavailable. Simply run stoptor if this happens and it will clear up the proxy back to it's default setting i.e. no proxy.

For those who prefer a video version of the same, check this out:

Youtube Demo

Top comments (0)