1

I'm failing to make every command in terminal (and ideally every MacOS app) to connect via TOR network by default in MacOS.

A simple test works when I expicitly request to use TOR proxy:

curl --socks5 localhost:9050 --socks5-hostname localhost:9050 -s https://check.torproject.org/ | cat | grep -m 1 Congratulations | xargs
Congratulations. This browser is configured to use Tor.

...but fails if I don't specify any proxy at all:

$ curl -s https://check.torproject.org/ | cat | grep -m 1 Sorry | xargs
Sorry. You are not using Tor.

I'm using VPN set in MacOS System Preferences; I'm on High Sierra 10.13.6.

This is what I've tried to make it work:

  • manually adding Advanced > Socks > Proxies > SOCKS > localhost:9050 to VPN and/or current Internet service (Wi-Fi) for current Network Location
  • manually creating a full clone of current Network Location and setting it up the same way
  • running . torsocks on in the Terminal window where I later run curl
  • running tor per se in a separate Terminal window; running brew services start tor

Using a script suggested at kremalicious results in:

$ INTERFACE=Automatic
$ sudo networksetup -setsocksfirewallproxy $INTERFACE 127.0.0.1 9050 off
Password:
** Error: The parameters were not valid.

$ sudo networksetup -setsocksfirewallproxystate $INTERFACE on
** Error: Unable to find item in network database.

Using torify results in error:

(torify curl -s https://check.torproject.org) | grep Congratulations
ERROR: /usr/bin/curl is located in a directory protected by Apple's System Integrity Protection.

1 Answer 1

0

Since you didn't mention it, I will suggest you edit your torrc configuration file. Ideally, you should have a line which looks like this:

SocksPort 9050
1
  • I just created such file with such a line, it didn't help. And, as I mentioned, if I specify for curl which host and port to use as proxy, it works just fine: curl --socks5 localhost:9050 --socks5-hostname localhost:9050 -s https://check.torproject.org/ => Congratulations. This browser is configured to use Tor. Commented Oct 15, 2019 at 1:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .