Unable to get control_auth_cookie file to be created in ~/.tor/ on Manjaro
I installed tor v0.4.6.9 using pamac (or it may have been preinstalled). In /etc/tor/torrc, I set ControlPort to 9051 and CookieAuthentication to 1. Under this condition, tor starts and the control_auth_cookie file is created at /var/lib/tor/control_auth_cookie.
However, for my project, we would like the control_auth_cookie file to be created in the user's home directory. When I set CookieAuthFile to /home/myuser/.tor/control_auth_cookie and restart tor (via systemctl), I get "Failed to parse/validate config: Couldn't access private data directory "/var/lib/tor" ". /var and /var/lib are owned by root and /var/lib/tor is owned by tor:tor, and these permissions and ownerships seem to be set/fixed automatically when tor is started.
I tried setting CookieAuthFileGroupReadable 1, DataDirectoryGroupReadable 1, and CacheDirectoryGroupReadable 1, but this didn't fix anything. I tried adding my user to the tor group, and that didn't help. I tried a few other things such as manually setting the permissions on /var /var/lib and /var/lib/tor to 777 (I know this is bad) but that didn't help either, and the permissions and owners were reset by tor when it restarted.
At one point I think it was also saying that it didn't have permission to /home/myuser/.tor, so I suspect what is happening is that the tor user is trying to create the control_auth_cookie file in ~/.tor, but since it is the tor user and not my user, it fails. If this is the problem, I don't know how to solve it.
Is it possible to have the control_auth_cookie file created in ~/.tor?
This was a default pamac install of tor on a fresh Manjaro install so I don't know why it didn't work to simply set ControlPort, CookieAuthentication, and CookieAuthFile in /etc/tor/torrc.
Can anyone tell me what the correct permissions and owners are supposed to be on the various folders tor accesses? Is there anywhere this information is officially or unofficially available?
Also, does anyone have a source for information on cross-platform differences in default tor install locations? For example, on Ubuntu the torrc file is located in /usr/local/etc/tor/torrc instead of /etc/tor/torrc.
I'd really appreciate any help or troubleshooting suggestions! This is for linking two totally different versions of the same free software app together over tor using a shared API so it's kinda neat :) (torControl.js works correctly ao-3 and should work in ao-react once we figure out the control port issue on Manjaro.)
Thanks for reading.