Project

General

Profile

Can't run tor as non-root user

54635 - 9 months ago -

Since the forum doesn't let me write the message correctly i uploaded my issue as a .txt file.
Thank you in advance!

issue.txt (860 Bytes) issue.txt

Replies (6)

RE: Can't run tor as non-root user - antalepo - 9 months ago -

You are not supposed to run tor as a another user manually. The binding error occurs because ports <1024 are reserved ports that require special permission to open.

Based on the setuid part, I believe your second issue stems from your current account not being allowed to switch to the tor user dedicated to running the service.

See man tor for the right solution:

User Username
    On startup, setuid to this user and setgid to their primary group. Can not be changed while tor is running.

And if we look in /etc/tor/torrc we can see the User setting right at the top.

Once correctly configured, do rc-service tor start (the service is from the package tor-openrc) to start it.

RE: Can't run tor as non-root user - 54635 - 9 months ago -

Thank you for answering.
I installed tor-openrc with no avail, it keep complaining i need to be super user. I also tried to reinstall everything and follow wiki's steps again.
I attach more info maybe i'm not seeing something.

torrc (11.6 KB) torrc
infos.txt (1.73 KB) infos.txt

RE: Can't run tor as non-root user - antalepo - 9 months ago -

Your torrc looks fine. I'm no expert in permissions, nor do I have a relay to compare them to, but they look good as well.

How are you running Tor? If you haven't, try rc-service tor start.

If that doesn't solve your issues, run tor as root (it will switch users to tor automatically) and post the output here (you can do tor |& tee log to log to the file log).

RE: Can't run tor as non-root user - 54635 - 9 months ago -

After installing tor-openrc i'm starting it with rc-srvice tor start. As non root it complain that superuser access is required, as root works fine.
I attached two logs but as non root it's the same issue i reported on the first post.

If running tor as root is safe because it drops privileges i can keep the current configuration.

RE: Can't run tor as non-root user - antalepo - 9 months ago -

It is safe to run as root, and it is the intended way. If you look at the official guide, https://community.torproject.org/relay/setup/guard/debianubuntu/, there is no mention of manually switching users.

By the way, both OpenRC and systemd run regular services as root (thus the need to run rc-service as root). User services do exist in systemd, but Tor is not one of them.

Lastly, in case you haven't already, run rc-update add tor to start the service on boot.

RE: Can't run tor as non-root user - 54635 - 9 months ago -

Thank you for the reassurance. I was worried becasue i was able to run the relay as non-root while using Trisquel (with systemd).
And thank you again for the time to help me out, i suppose the topic can be closed if necessary ^^

    (1-6/6)