3

On Ubuntu, how come Tor (0.2.4.20-1) doesn't create control_auth_cookie anywhere on the system after enabling CookieAuthentication in /etc/tor/torrc?

# /etc/init.d/tor start
* Starting tor daemon...                                             [ OK ]
# tail -n 2 /var/log/tor/log
Nov 24 14:09:06.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 24 14:09:06.000 [notice] Bootstrapped 100%: Done.
# grep "\(DataD\|Cook\)" /etc/tor/torrc
DataDirectory /var/lib/tor
CookieAuthentication 1
  • What makes you think it hasn't? Where did you look for the cookie? How did you enable CookieAuthentication (what value did you set it to)? – Sam Whited Nov 24 '14 at 15:54
  • I did a find / -name "control_auth_cookie". I enabled it by uncommenting CookieAuthentication 1. – Mark Boulder Nov 24 '14 at 20:43
  • Could you edit your post and insert the output of grep "\(DataD\|Cook\)" /etc/tor/torrc? – Jens Kubieziel Nov 25 '14 at 8:56
  • @JensKubieziel all done! – Mark Boulder Nov 25 '14 at 10:41
  • So there should be a file in /var/lib/tor/control_auth_cookie. I tested it locally and it worked fine. Has the logfile some hints if something went wrong? – Jens Kubieziel Nov 26 '14 at 20:34
2

Your Tor is probably under the impression that it has already created one. (Maybe it did and you deleted it?)
Try the following:

  • Edit your torrc to set CookieAuthentication to 0
  • reset your Tor (kill -HUP or hit x twice in Arm)
  • Edit your torrc again to set CookieAuthentication back to 1
  • reset your Tor again.

You should now have a new control cookie.

Make sure you have a ControlListenAddress and/or ControlPort set.

  • Tried again with Debian this time. Still nothing. – Mark Boulder Feb 14 '15 at 21:06
0

If you're using the package from universe/net, the /usr/share/tor/tor-service-defaults-torrc file overrides the cookie location to /var/run/tor/control.authcookie. You should be able to find it there, or you can override that setting by adding the following line to /etc/tor/torrc:

CookieAuthFile /var/lib/tor/control_auth_cookie
0

It probably did create the file, but the permissions are set badly by the default tor process when it creates it.

Meaning, it's not readable to you.

On my installation, tor:

1) creates the file with 600, owned by tor:tor

2) the /var/lib/tor/ folder is 700, owned by tor:tor

So, even if the user I login with is in the tor group; the folder is still inaccessible, and the file is invisible/unreadable.

I have to manually alter these to sensible values (640 and 750, respectively) every time the tor daemon reloads (because it resets them back to stupid every time), in order for anything I run to use the control port.

Both permissions failures have to be manually fixed every single time...

Herp derp...

New contributor
camosoul is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.