3

I recently decided to run an exit node on a VPS running the standard build of OpenBSD 5.5. Tor, which had no missing dependencies, was the first program I installed. I did so by simply downloading the source and following the build instructions. The only other program installed is a simple SSH login protector. However, when I run Tor using sudo tor --hush, the process remains a root process. This is despite the fact that the SSH login user non-root with sudo access through the wheel group.

Here's an example output of the start-up, which makes it explicit that it successfully binds to the desired ports:

$ sudo tor
Aug 19 07:29:43.103 [notice] Tor v0.2.4.23 (git-598c61362f1b3d3e) running on OpenBSD with Libevent 1.4.14b-stable and OpenSSL 1.0.1c.
Aug 19 07:29:43.105 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 19 07:29:43.105 [notice] Read configuration file "/usr/local/etc/tor/torrc".
Aug 19 07:29:43.115 [notice] Opening Control listener on 127.0.0.1:9052
Aug 19 07:29:43.116 [notice] Opening OR listener on 0.0.0.0:443
Aug 19 07:29:43.116 [notice] Opening Directory listener on 0.0.0.0:80

I'm not sure if this is relevant, but the data directory being created is /home/my_user/.tor.

Is this a known issue? It's odd, considering that (if I recall correctly) OpenBSD introduced privilege separation to the Unix community. Regardless, I took the server down, and won't restart it until I solve this issue.

Anecdotally, I'm also trying to figure out where the log files are, as /var/log/tor doesn't exist. That's an easier issue, though.

Roya
  • 3,240
  • 3
  • 19
  • 40
Mike
  • 148
  • 7

1 Answers1

2

If you run it with sudo, of course it will be run as root. It also makes sense that it uses your HOME directory. Doing a sudo echo $HOME explains why. So this doesn't appear to be wrong, but expected behavior.

What you probably want to do is have a torrc and set things like logging using the Log option and User <username>, so privileges are dropped to the specified user.

OpenBSD appears to patch the torrc sample config in a way that logs are handled via syslog.

meee
  • 1,212
  • 2
  • 9
  • 21