Difference between revisions of "TOR node at home, cloud IP"

From lightningwiki.net
Jump to navigation Jump to search
(Created page with "If you have a 100% TOR host at home and do not want to expose your home IP, but still want a clearnet IP, you can "export" the port on your VPS. =Requirements= * TOR reachabl...")
 
 
Line 30: Line 30:
chmod +x /root/tunnel
chmod +x /root/tunnel
echo "*/15  * * * * root /root/tunnel" >> /etc/cron.d/tunnel
echo "*/15  * * * * root /root/tunnel" >> /etc/cron.d/tunnel
</pre>
in ~/.lnd/lnd.conf add:
<pre>
externalip=1.2.3.4
externalhosts=addr.onion
</pre>
</pre>

Latest revision as of 12:19, 16 October 2020

If you have a 100% TOR host at home and do not want to expose your home IP, but still want a clearnet IP, you can "export" the port on your VPS.

Requirements

  • TOR reachable lightning node
  • VPS

Steps

On your home node:

ssh-keygen #run, follow steps, do not set a passphrase
cat ~/.ssh/id_rsa.pub #copy this key

On the VPS, as the root user:

sudo -i
useradd --create-home--shell lightningnode
mkdir /home/lightningnode/.ssh
chmod 0700 /home/lightningnode/.ssh
nano /home/lightningnode/.ssh # paste the key, save
chmod 0400 /home/lightningnode/.ssh
nano /etc/ssh/sshd_config # change GatewayPorts to yes (possibly uncomment)
systemctl restart sshd

On the node at home:

sudo -i
echo -e "#!/bin/bash\nnmap -p 9735 vps.net | grep open >/dev/null || ssh -NR *:9735:127.0.0.1:9735 lightningnode@vps.net" >> /root/tunnel
chmod +x /root/tunnel
echo "*/15  * * * * root /root/tunnel" >> /etc/cron.d/tunnel

in ~/.lnd/lnd.conf add:

externalip=1.2.3.4
externalhosts=addr.onion