0

I have torrc-default file and torrc custom file on mac at:

/Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor

folder (the package of the app).

In both files it is specified:

SocksPort 9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth
ControlPort 9151

But when I start tor from unix, it loads listening to 9050.

So I tried to look at configuration in [https://tor.stackexchange.com/a/11870]:

~/Library/Application Support/TorBrowser-Data/torrc

and here I find :

# This file was generated by Tor; if you edit it, comments will not be preserved
# The old torrc file was renamed to torrc.orig.1 or similar, and Tor will ignore it

DataDirectory /Applications/TorBrowser.app/TorBrowser/Data/Tor

So, where does the port 9050 come from?

enter image description here


EDITED after comment

I start the application from the folder where tor file is: /Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor. That folder also contains torrc and torrc-default files.

I tried:

./tor -f torrc 

and:

Oct 28 20:16:17.741 [notice] Tor v0.2.8.7 (git-263088633a63982a) running on Darwin with Libevent 2.0.22-stable, OpenSSL 1.0.1t and Zlib 1.2.5.
Oct 28 20:16:17.742 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Oct 28 20:16:17.757 [warn] Unable to open configuration file "/Applications/TorBrowser.app/Contents/MacOS/Tor/torrc".
Oct 28 20:16:17.757 [err] Reading config failed--see warnings above.
1

9050 is a builtin default, from the Tor Manual...

SocksPort [address:]port|unix:path|auto [flags] [isolation flags]

Open this port to listen for connections from SOCKS-speaking applications. Set this to 0 if you don’t want to allow application connections via SOCKS. Set it to "auto" to have Tor pick a port for you. This directive can be specified multiple times to bind to multiple addresses/ports. (Default: 9050)

When you're starting it "from unix", it's probably looking for the default torrc, not finding any defined in the builtin default location (you need to specify the location with -f and optional --defaults-torrc if it's not in the location it was told to look when it was compiled) and instead falling back to it's default settings.

  • Hi canonizing ironize (great nick!) - Please see updated question. – user305883 Oct 28 '16 at 18:14
  • It looks like there's some kind of file permissions error, as far as it can tell the file doesn't exist, or at least tor can't access it. Does OSX do weird stuff with the foo.app, isn't it some kind of archive that needs to be specially handled? tor may not be able to handle it, it expects a plain file. My knowledge of OSX internals is limited as I've never used it before. – cacahuatl Oct 28 '16 at 21:29
  • What happens if you just run cat torrc from the directory, for example? Do you see the file contents as expected? As far as I'm aware all that stuff should now be in the ~/Library/Application Support/TorBrowser-Data/ folder because there are issues with the OSX package signing when you edit the contents of the package. Writing Tor's state and any configuration settings out inside the .app will make the signature invalid. (This is my understanding, I don't so OSX or any Apple products.) – cacahuatl Oct 29 '16 at 1:42
  • I can see the file with cat torrc. In ~/Library/Application Support/TorBrowser-Data/ there is a torrc file with datadirectory pointing to Application folders. It can't open it. Strange part is that if I run tor from terminal, it ignores torrc files and listen on 9050. If I run tor browser, it will read configuration file and listen also on number 9150. – user305883 Oct 29 '16 at 8:10
  • It's not ignoring the torrc, it just can't open it for some reason. I'm unsure why, if Tor is running as the same user and your user can read it I don't see why the tor process can't. I'm assuming OS X quirks that I'm unaware of. – cacahuatl Oct 30 '16 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.