Tor control port access

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_LIVE_PATCH_STATUS[0]=‘not applicable’
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bullseye 0
  • Kernel version | uname -a
    Linux pubbypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | dpkg --print-architecture
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi 4 Model B (aarch64)

I’m trying to access my tor controlport with my own script to send newnym/exit-node/etc but I don’t actually recall setting a password for it, only had the one set for the tor hotspot in hostapd. I connected and checked:

250-AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/run/tor/control.authcookie"
250-VERSION Tor=""
250 OK

How do I authenticate to the control port? Usually I would always opt for no auth since it’s nestled safe inside one of my internal lan subnets but is there some default password? I don’t mind either setting a password or disabling auth, just not sure where to do either.

Hmm that was weird, I did edit my torrc to use:
CookieAuthentication 0
and I restarted my server but it still didn’t let me access with no auth, but a few minutes later control.authcookie disappeared from /run/tor so I suppose it just took time to kick in? I did manage to not need auth after that.

Check /etc/tor/torrc.