1

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 127.0.0.1:9050
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 127.0.0.1:9050          0.0.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
0

You seem to have a firewall/SELinux issue. What are your torrc and dmesg ? Can you please post them?

  • 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 '16 at 20:44
  • 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 '16 at 21:02
  • Look please at the bottom of the page. I've added it to my other answer. – Hirsch Mar 16 '16 at 21:37
  • Another try: After I deleted the User debian-tor option but with the RunAsDaemon0 option tor starts but nothing changed. – Hirsch Mar 16 '16 at 21:43
  • With the User option I must run tor as root. But I don't want to run tor as root and I don`t need to normally. – Hirsch Mar 16 '16 at 21:53
0

@Alexey Vesnin

root@Raspb:/home/torpi# /usr/local/bin/tor -f /usr/local/etc/tor/torrc
Mar 16 23:07:37.000 [notice] Tor 0.2.7.6 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 https://www.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 override this by setting MaxMemInQueues by hand.
Mar 16 23:07:37.769 [notice] Opening Socks listener on 127.0.0.1:9050
Mar 16 23:07:37.771 [notice] Opening OR listener on 0.0.0.0:443
Mar 16 23:07:37.773 [notice] Opening Directory listener on 0.0.0.0:80
Mar 16 23:07:37.782 [warn] Fixing permissions on directory /usr/local/tor-data
Mar 16 23:07:37.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Mar 16 23:07:37.000 [notice] Not disabling debugger attaching for unprivileged users.
Mar 16 23:07:37.000 [notice] Parsing GEOIP IPv4 file /usr/local/share/tor/geoip.
Mar 16 23:07:40.000 [notice] Parsing GEOIP IPv6 file /usr/local/share/tor/geoip6.
Mar 16 23:07:41.000 [notice] Configured to measure statistics. Look for the *-stats files that will first be written to the data directory in 24 hours from now.
Mar 16 23:07:43.000 [notice] You are running a new relay. Thanks for helping the Tor network! If you wish to know what will happen in the upcoming weeks regarding its usage, have a look at https://blog.torproject.org/blog/lifecycle-of-a-new-relay
Mar 16 23:07:43.000 [notice] It looks like I need to generate and sign a new medium-term signing key, because I don't have one. To do that, I need to load (or create) the permanent master identity key.
Mar 16 23:07:48.000 [notice] Your Tor server's identity key fingerprint is 'ZeiberSchnitzel 716C7DF3BDB880626E21793B9521F6373266B134'
Mar 16 23:07:48.000 [notice] Bootstrapped 0%: Starting
Mar 16 23:07:48.000 [notice] Guessed our IP address as 37.138.181.251 (source: 194.109.206.212).
Mar 16 23:07:49.000 [notice] Bootstrapped 5%: Connecting to directory server
Mar 16 23:07:49.000 [notice] Bootstrapped 10%: Finishing handshake with directory server
Mar 16 23:07:50.000 [notice] Bootstrapped 15%: Establishing an encrypted directory connection
Mar 16 23:07:50.000 [notice] Bootstrapped 20%: Asking for networkstatus consensus
Mar 16 23:07:50.000 [notice] Bootstrapped 25%: Loading networkstatus consensus
Mar 16 23:07:53.000 [notice] I learned some more directory information, but not enough to build a circuit: We have no usable consensus.
Mar 16 23:07:54.000 [notice] Bootstrapped 40%: Loading authority key certs
Mar 16 23:07:57.000 [notice] Bootstrapped 45%: Asking for relay descriptors
Mar 16 23:07:57.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 0/7119, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of exit bw = 0% of path bw.)
Mar 16 23:07:59.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 0/7119, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of exit bw = 0% of path bw.)
Mar 16 23:08:01.000 [notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.
Mar 16 23:08:01.000 [notice] Bootstrapped 50%: Loading relay descriptors
Mar 16 23:08:12.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 118/7119, and can only build 0% of likely paths. (We have 2% of guards bw, 2% of midpoint bw, and 2% of exit bw = 0% of path bw.)
Mar 16 23:08:25.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 569/7119, and can only build 0% of likely paths. (We have 9% of guards bw, 9% of midpoint bw, and 6% of exit bw = 0% of path bw.)
Mar 16 23:08:30.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 1026/7119, and can only build 0% of likely paths. (We have 15% of guards bw, 16% of midpoint bw, and 13% of exit bw = 0% of path bw.)
Mar 16 23:08:37.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 1526/7119, and can only build 1% of likely paths. (We have 24% of guards bw, 23% of midpoint bw, and 19% of exit bw = 1% of path bw.)
Mar 16 23:08:44.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 1982/7119, and can only build 2% of likely paths. (We have 33% of guards bw, 31% of midpoint bw, and 27% of exit bw = 2% of path bw.)
Mar 16 23:08:50.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2440/7119, and can only build 5% of likely paths. (We have 38% of guards bw, 37% of midpoint bw, and 36% of exit bw = 5% of path bw.)
Mar 16 23:09:02.000 [notice] Tor 0.2.7.6 opening log file.
Mar 16 23:09:02.426 [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:09:02.429 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Mar 16 23:09:02.431 [notice] Read configuration file "/usr/local/etc/tor/torrc".
Mar 16 23:09:02.470 [notice] Based on detected system memory, MaxMemInQueues is set to 278 MB. You can override this by setting MaxMemInQueues by hand.
Mar 16 23:09:02.478 [notice] Opening Socks listener on 127.0.0.1:9050
Mar 16 23:09:02.480 [notice] Opening OR listener on 0.0.0.0:443
Mar 16 23:09:02.482 [notice] Opening Directory listener on 0.0.0.0:80
Mar 16 23:09:02.490 [warn] Fixing permissions on directory /usr/local/tor-data
Mar 16 23:09:02.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Mar 16 23:09:02.000 [notice] Not disabling debugger attaching for unprivileged users.
Mar 16 23:09:02.000 [notice] Parsing GEOIP IPv4 file /usr/local/share/tor/geoip.
Mar 16 23:09:04.000 [notice] Parsing GEOIP IPv6 file /usr/local/share/tor/geoip6.
Mar 16 23:09:05.000 [notice] Configured to measure statistics. Look for the *-stats files that will first be written to the data directory in 24 hours from now.
Mar 16 23:09:08.000 [notice] Your Tor server's identity key fingerprint is 'ZeiberSchnitzel 716C7DF3BDB880626E21793B9521F6373266B134'
Mar 16 23:09:08.000 [notice] Bootstrapped 0%: Starting
Mar 16 23:09:32.000 [notice] Bootstrapped 45%: Asking for relay descriptors
Mar 16 23:09:33.000 [notice] Guessed our IP address as 37.138.181.251 (source: 194.109.206.212).
Mar 16 23:09:34.000 [notice] Bootstrapped 52%: Loading relay descriptors
Mar 16 23:09:34.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2536/7119, and can only build 5% of likely paths. (We have 40% of guards bw, 38% of midpoint bw, and 36% of exit bw = 5% of path bw.)
Mar 16 23:09:36.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2632/7119, and can only build 6% of likely paths. (We have 41% of guards bw, 39% of midpoint bw, and 37% of exit bw = 6% of path bw.)
Mar 16 23:09:37.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2728/7119, and can only build 6% of likely paths. (We have 42% of guards bw, 40% of midpoint bw, and 37% of exit bw = 6% of path bw.)
Mar 16 23:09:39.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2824/7119, and can only build 7% of likely paths. (We have 43% of guards bw, 42% of midpoint bw, and 40% of exit bw = 7% of path bw.)
Mar 16 23:09:40.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 2919/7119, and can only build 8% of likely paths. (We have 45% of guards bw, 43% of midpoint bw, and 41% of exit bw = 8% of path bw.)
Mar 16 23:09:41.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3014/7119, and can only build 8% of likely paths. (We have 46% of guards bw, 44% of midpoint bw, and 42% of exit bw = 8% of path bw.)
Mar 16 23:09:42.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3109/7119, and can only build 9% of likely paths. (We have 47% of guards bw, 46% of midpoint bw, and 44% of exit bw = 9% of path bw.)
Mar 16 23:09:43.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3203/7119, and can only build 10% of likely paths. (We have 48% of guards bw, 47% of midpoint bw, and 45% of exit bw = 10% of path bw.)
Mar 16 23:09:45.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3299/7119, and can only build 11% of likely paths. (We have 50% of guards bw, 49% of midpoint bw, and 46% of exit bw = 11% of path bw.)
Mar 16 23:09:49.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3300/7119, and can only build 11% of likely paths. (We have 50% of guards bw, 49% of midpoint bw, and 46% of exit bw = 11% of path bw.)
Mar 16 23:09:53.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3394/7119, and can only build 12% of likely paths. (We have 52% of guards bw, 51% of midpoint bw, and 48% of exit bw = 12% of path bw.)
Mar 16 23:09:54.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3491/7119, and can only build 13% of likely paths. (We have 53% of guards bw, 52% of midpoint bw, and 48% of exit bw = 13% of path bw.)
Mar 16 23:09:56.000 [notice] Bootstrapped 57%: Loading relay descriptors
Mar 16 23:09:56.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3586/7119, and can only build 14% of likely paths. (We have 54% of guards bw, 53% of midpoint bw, and 51% of exit bw = 14% of path bw.)
Mar 16 23:09:59.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3592/7119, and can only build 14% of likely paths. (We have 54% of guards bw, 53% of midpoint bw, and 51% of exit bw = 14% of path bw.)
Mar 16 23:09:59.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 3600/7119, and can only build 14% of likely paths. (We have 54% of guards bw, 53% of midpoint bw, and 51% of exit bw = 14% of path bw.)
Mar 16 23:10:07.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 4020/7119, and can only build 20% of likely paths. (We have 59% of guards bw, 58% of midpoint bw, and 57% of exit bw = 20% of path bw.)
Mar 16 23:10:12.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 4382/7119, and can only build 24% of likely paths. (We have 64% of guards bw, 63% of midpoint bw, and 60% of exit bw = 24% of path bw.)
Mar 16 23:10:16.000 [notice] Bootstrapped 65%: Loading relay descriptors
Mar 16 23:10:16.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 4837/7119, and can only build 32% of likely paths. (We have 68% of guards bw, 67% of midpoint bw, and 69% of exit bw = 32% of path bw.)
Mar 16 23:10:21.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 5287/7119, and can only build 40% of likely paths. (We have 74% of guards bw, 74% of midpoint bw, and 74% of exit bw = 40% of path bw.)
Mar 16 23:10:27.000 [notice] Bootstrapped 75%: Loading relay descriptors
Mar 16 23:10:27.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 5746/7119, and can only build 53% of likely paths. (We have 80% of guards bw, 80% of midpoint bw, and 81% of exit bw = 53% of path bw.)
Mar 16 23:10:38.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Mar 16 23:10:39.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
Mar 16 23:10:41.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Mar 16 23:10:48.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Mar 16 23:10:48.000 [notice] Bootstrapped 100%: Done
Mar 16 23:10:48.000 [notice] Now checking whether ORPort 37.138.181.251:443 and DirPort 37.138.181.251:80 are reachable... (this may take up to 20 minutes -- look for log messages indicating success)
Mar 16 23:10:50.000 [notice] Self-testing indicates your DirPort is reachable from the outside. Excellent.
Mar 16 23:10:58.000 [notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.
Mar 16 23:11:03.000 [notice] Performing bandwidth self-test...done.
0

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 127.0.0.1:9051 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.