From ff090ecfe62fe39ba4b69e5e30dd9b840a9ed8a1 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj jxPCSnmZ Date: Thu, 19 Nov 2020 09:15:53 +0800 Subject: [PATCH] doc/TOR.md: Add missing instructions to add user to Tor group. Changelog-None Fixes: #4208 --- doc/TOR.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/doc/TOR.md b/doc/TOR.md index 5b168fbfa..9a9215bb5 100644 --- a/doc/TOR.md +++ b/doc/TOR.md @@ -69,6 +69,54 @@ Uncomment those in, then restart `tor` (usually `systemctl restart tor` or Debian and Ubuntu, or just restart the entire computer if you cannot figure it out). +On some systems (such as Arch Linux), you may also need to add the following +setting: + +``` +DataDirectoryGroupReadable 1 +``` + +You also need to make your user a member of the Tor group. +"Your user" here is whatever user will run `lightningd`. +On Debian-derived systems, the Tor group will most likely be `debian-tor`. +You can try listing all groups with the below command, and check for a +`debian-tor` or `tor` groupname. + +``` +getent group | cut -d: -f1 | sort +``` + +Alternately, you could check the group of the cookie file directly. +Usually, on most Linux systems, that would be `/run/tor/control.authcookie`: + +``` +stat -c '%G' /run/tor/control.authcookie +``` + +Once you have determined the `${TORGROUP}` and selected the +`${LIGHTNINGUSER}` that will run `lightningd`, run this as root: + +``` +usermod -a -G ${TORGROUP} ${LIGHTNINGUSER} +``` + +Then restart the computer (logging out and logging in again should also +work). +Confirm that `${LIGHTNINGUSER}` is in `${TORGROUP}` by running the +`groups` command as `${LIGHTNINGUSER}` and checking `${TORGROUP}` is listed. + +If the `/run/tor/control.authcookie` exists in your system, then log in as +the user that will run `lightningd` and check this command: + +``` +cat /run/tor/control.authcookie > /dev/null +``` + +If the above prints nothing and returns, then C-Lightning "should" work +with your Tor. +If it prints an error, some configuration problem will likely prevent +C-Lightning from working with your Tor. + Then make sure these are in your `${LIGHTNING_DIR}/config` or other C-Lightning configuration (or prepend `--` to each of them and add them to your `lightningd` invocation command line):