I have a problem with tor (this version and also 0.2.7.*). After compilation, with and without installation afterwards, I can'treach port 9050. I would like to see with arm what's going on but it doesn`t work.

blabla@Raspb:~$ sudo -u debian-tor arm
Connection refused. Is the ControlPort enabled?

When I do this it won`t work either.

blabla@Raspb:~$ sudo -u debian-tor arm -i
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/TorCtl/TorCtl.py", line 645, in _loop
    isEvent, reply = self._read_reply()
  File "/usr/lib/python2.7/dist-packages/TorCtl/TorCtl.py", line 820, in _read_reply
    raise ProtocolError("Badly formatted reply line: unknown type %r"%tp)
ProtocolError: Badly formatted reply line: unknown type 'P'

But tor binds the port

blabla@Raspb:~$ sudo netstat -tulpan | grep "9050"
[sudo] password for torpi: 
tcp        0      0*               LISTEN      17247/tor

I`ve search many things but still got no solution. My torrc works fine. I have to say on the beginning tor can't bind port 80 and 443. After I did this it worked.

sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/tor

Is their relation compared to port 9050? When I install tor from the repositories all worked fine.

SocksPort 9050 # Default: Bind to localhost:9050 for local connections.
Log notice file /var/log/tor/notices.log
Log debug file /var/log/tor/debug.log
RunAsDaemon 1
ORPort 443
Nickname ZeiberSchnitzel
RelayBandwidthRate 1000 KB  # Throttle traffic to 100KB/s (800Kbps)
RelayBandwidthBurst 1600 KB # But allow bursts up to 200KB/s (1600Kbps)
ContactInfo ZeiberSchnitzel <maillinglist@pboenig.de>
DirPort 80 # what port to advertise for directory connections
ExitPolicy reject *:* # no exits allowed
DisableDebuggerAttachment 0
AvoidDiskWrites 1
NumCPUs 1
  • You seem to have a firewall/SELinux issue. What are your torrc and dmesg ? Can you please post them?
    – Alexey Vesnin
    Mar 16, 2016 at 20:37
  • I think don't think it is a firewall issue because before I compiled tor (0.2.7.*) I ran a tor (0.2.5.*) relay on the same pi. But the 0.2.5.* version was installed from the repos and worked just fine. For my torrc and dmesg look above.
    – Hirsch
    Mar 16, 2016 at 20:44
  • @Alexey Vesnin root@Raspb:/home/torpi# /usr/local/bin/tor -f /usr/local/etc/tor/torrc Mar 16 23:07:37.000 [notice] Tor opening log file. Mar 16 23:07:37.718 [notice] Tor v0.2.7.6 running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.1k and Zlib 1.2.8. Mar 16 23:07:37.721 [notice] Tor can't help you if you use it wrong! Learn how to be safe at torproject.org/download/download#warning Mar 16 23:07:37.723 [notice] Read configuration file "/usr/local/etc/tor/torrc". Mar 16 23:07:37.761 [notice] Based on detected system memory, MaxMemInQueues is set to 278 MB. You can overri
    – Hirsch
    Mar 16, 2016 at 20:50
  • set RunAsDaemon to 0 and add last line User debian-tor or if it's named as different one write your user there. And run it from foreground like /path/to/tor -f /path/to/torrc - and send a log here, please.
    – Alexey Vesnin
    Mar 16, 2016 at 21:02
  • Look please at the bottom of the page. I've added it to my other answer.
    – Hirsch
    Mar 16, 2016 at 21:37

1 Answer 1


Success! It's running.

@Alexey Vesnin you made my day!

The last post from you was the right guess. I edited my torrc like you said:

  • uncomment ControlPort 9051

  • uncomment CookieAuthentication 1

  • I generated the password with tor --hash-password [YOUR PASSWORD] and copied it

  • uncomment HashedControlPassword [YOUR copied PASSWORD]

After all arm runs with sudo -u debian-tor arm -i perfectly. (On first start it takes 1 minute or so until the password prompt is shown).

P.S.: But why I have to point on Port 9051 not 9050?

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.