Skip to content

Instantly share code, notes, and snippets.

@jorgerance
Created December 24, 2019 07:20
Show Gist options
  • Save jorgerance/a1f93b91ed72c79e7a5ac51f3a818cb6 to your computer and use it in GitHub Desktop.
Save jorgerance/a1f93b91ed72c79e7a5ac51f3a818cb6 to your computer and use it in GitHub Desktop.
[tor isolation - macOS] tor as a service on multiple ports #homebrew #tor #privacy

Install tor on macOS

0 ✓ user@macos ~ $ brew install tor
==> Downloading https://homebrew.bintray.com/bottles/tor-0.4.2.5.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/82/8231f0d4bf6e158a85672f9a29a8bccb50152cf039cbc996b29f45031dc65e29?__gda__=exp=1577172051~hmac=89164770fc6a2d95795cf220c52b76e9f809a781307557930ddce7f6c1a6
######################################################################## 100.0%
==> Pouring tor-0.4.2.5.mojave.bottle.tar.gz
==> Caveats
To restart tor after an upgrade:
  brew services restart tor
Or, if you don't want/need a background service you can just run:
  tor
==> Summary
🍺  /usr/local/Cellar/tor/0.4.2.5: 24 files, 13.5MB
0 ✓ user@macos ~ $

Configure tor service: /usr/local/etc/tor/torrc

# Add as many ports as applications you plan to isolate
# Avoid port 9051 (tor default control port) or define "ControlPort <PORT>"

SOCKSPort 9050      # Default - Binds to localhost:9050
SOCKSPort 9049      # Email
SOCKSPort 9048      # XMPP
SOCKSPort 9047      # Chromium
SOCKSPort 9046		# Firefox
SOCKSPort 9045		# ...

Restart tor

0 ✓ user@macos ~ $ brew services restart tor
Stopping `tor`... (might take a while)
==> Successfully stopped `tor` (label: homebrew.mxcl.tor)
==> Successfully started `tor` (label: homebrew.mxcl.tor)
0 ✓ user@macos ~ $

Loof for listening tor socks

0 ✓ user@macos ~ $ lsof -i tcp|grep '^tor' | grep ' (LISTEN)$'
tor       11111   user    5u  IPv4 0x0000000000000000      0t0  TCP localhost:9050 (LISTEN)
tor       11111   user    6u  IPv4 0x0000000000000000      0t0  TCP localhost:9049 (LISTEN)
tor       11111   user    7u  IPv4 0x0000000000000000      0t0  TCP localhost:9048 (LISTEN)
tor       11111   user    8u  IPv4 0x0000000000000000      0t0  TCP localhost:9047 (LISTEN)
tor       11111   user    9u  IPv4 0x0000000000000000      0t0  TCP localhost:9046 (LISTEN)
0 ✓ user@macos ~ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment