| Description | Command |
---|
| Install Tor From the Official Repository |
---|
1 | Add the Tor repository to your package sources |
Code Block |
---|
| sudo su -c "echo 'deb httphttps://deb.torproject.org/torproject.org '$(lsb_release -c | cut -f2)' main' > /etc/apt/sources.list.d/torproject.list" |
|
2 | Pull the gpg key used to sign the tor packages | Pulling the gpg key may take some time, if it times out, run it again until it has been imported Code Block |
---|
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import |
|
3 | Export the key and add to apt, this enables package verification |
Code Block |
---|
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - |
|
4 | Update the package cache with tor repositories added as sources |
Code Block |
---|
sudo apt-get update |
|
5 | Install tor |
Code Block |
---|
sudo apt-get install tor deb.torproject.org-keyring -y |
|
6 | Add your current user to the debian-tor group to be able to use cookie authentication |
Code Block |
---|
sudo usermod -a -G debian-tor $USER |
|
7 | Run the sg command with bash to start a new shell, this is required for bash to identify the non-root user being added to the debian-tor group (it prevents having to exit and login) |
Code Block |
---|
sg debian-tor -c "bash" |
|
| Create and Execute Tor Script |
---|
8 | Update the torrc file to make tor work with the zen daemon - Some tor repo updates make changes to the torrc file, this script is intended to repair the tor service for zend
| The following block of text is meant to be copied and pasted in its entirety Code Block |
---|
cat <<EOF > ~/tor.sh
#!/bin/bash
sudo sed -i 's/#ControlPort 9051/ControlPort 9051/g' /etc/tor/torrc
sudo sed -i 's/#CookieAuthentication 1/CookieAuthentication 1/g' /etc/tor/torrc
sudo su -c "echo 'CookieAuthFileGroupReadable 1' >> /etc/tor/torrc"
sudo su -c "echo 'LongLivedPorts 9033' >> /etc/tor/torrc"
sudo systemctl restart tor.service
EOF |
Code Block |
---|
chmod u+x ~/tor.sh |
|
| Restart Zend and Check Network Configuration |
---|
9 | Stop zend and the tracker using systemd or with pm2 & monit and apply ownership to the non-root user of all files created since step 7, to enable tor in the zend daemon | For installations using systemd Code Block |
---|
sudo systemctl stop zend zentracker && sleep 30 && chown -R $USER:$USER ~/ && sudo systemctl start zend zentracker |
For installations using monit (zend) and pm2 (tracker) Code Block |
---|
sudo monit stop zend && pm2 stop 0 && sleep 30 && chown -R $USER:$USER ~/ && sudo monit start zend && sleep 8 && pm2 start 0 |
|
10 | Verify that tor is enabled in zend by checking the network info - See the example output, the important details being in bold
|
Code Block |
---|
zen-cli getnetworkinfo |
Panel |
---|
borderColor | grey |
---|
bgColor | black |
---|
titleColor | white |
---|
borderWidth | 2 |
---|
titleBGColor | black |
---|
borderStyle | solid |
---|
title | Example Output |
---|
| { "name": "onion", "limited": false, "reachable": true, "proxy": "127.0.0.1:9050", "proxy_randomize_credentials": true } ], "relayfee": 0.00000100, "localaddresses": [ { "address": "xxxxxxxxxxxxxxxxxx.onion", "port": 9033, "score": 5 } |
|
| Optional - Add Nodes |
---|
11 | Use nano and append tor nodes to the bottom of your zen.conf - Save and exit with CTRL+x, type y, then hit enter
NOTE: You will need to restart zend for changes to take effect |
Code Block |
---|
nano ~/.zen/zen.conf |
Panel |
---|
borderColor | grey |
---|
bgColor | black |
---|
titleColor | white |
---|
borderWidth | 2 |
---|
titleBGColor | black |
---|
borderStyle | solid |
---|
title | Example Output |
---|
| rpcuser=XXXXXXXXXXXXXXXX rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX rpcport=18231 rpcallowip=127.0.0.1 server=1 daemon=1 listen=1 txindex=1 logtimestamps=1 ### testnet config #testnet=1 tlscertpath=/etc/letsencrypt/live/node01.zentest.win/cert.pem tlskeypath=/etc/letsencrypt/live/node01.zentest.win/privkey.pem externalip=123.123.123.123 externalip=2123:423:1c23:1823::1 port=9033 addnode=664sm6tboxgulaar.onion addnode=k6yjiqxfehnbey5x.onion addnode=ktp7b3ffc324zeoq.onion addnode=k4mndsz24sj2fk7w.onion addnode=52ywlur6mlmpl62j.onion addnode=e5nntkmas4nxxhxd.onion addnode=ifmrspt373jdl6b6.onion addnode=4mt3rihnc6jmud3b.onion |
|