4

I am trying to run hidden services with tor. But when I start it just using tor I get this error:

... is not owned by this user (user, 1000) but by debian-tor (118). Perhaps you are running Tor as the wrong user?

When I run it using sudo tor:

... is not owned by this user (root, 0) but by debian-tor (118). Perhaps you are running Tor as the wrong user?

And when I try sudo service tor start it doesn't show any errors but it still doesn't works.

I also added User debian-tor to torrc. But than I get the error Directory /root/.tor cannot be read: Permission denied when I run it as root(sudo tor). And the error Directory ... cannot be read: Permission denied when I run it with tor or as service.

When I change the owner of the directory to root I can start it with sudo tor but still not with sudo service tor start, I also don't think it is save tor run it with the root user.

I am using Debian Jessie. Does anyone know how I can fix this? I want to run tor as a service.

EDIT: I installed centos and got the exact same error...

But i found out when I use /var/lib/tor/ as directory it works! But when I use /var/lib/tor/hidden_service/ (With user _tor as owner) I still have an permission error. I tried to add ReadWriteDirectories to tor.service with /var/lib/tor/hidden_service/ as directory. But that also doesn't work.

Jan Wytze
  • 203
  • 1
  • 2
  • 8

4 Answers4

4

When you want to start via command line you need to do it as the correct user. As the message says it expects debian-tor. So call Tor in the following way:

sudo -u debian-tor tor
Jens Kubieziel
  • 8,630
  • 5
  • 35
  • 116
4

I found out that tor was blocked by SElinux. I disabled SElinux and everything was working.

Jan Wytze
  • 203
  • 1
  • 2
  • 8
0
sudo chown debian-tor:debian-tor /var/lib/tor/site/
sudo systemctl restart tor

fixed it for me.

-1

You're missing DataDirectory /usr/tor/data in your torrc. And make a debian-tor user you've mentioned in your setup have a /bin/bash shell and a home directory /usr/tor - it will solve your problem and help you to run pluggable transports without a problem. Do it like this from root :

mkdir -p /usr/tor/data
chown -R debian-tor:`id -g debian-tor` /usr/tor
usermod -d /usr/tor -s /bin/bash debian-tor
Alexey Vesnin
  • 6,385
  • 3
  • 15
  • 36