TOR node at home, cloud IP

From lightningwiki.net
Revision as of 12:08, 16 October 2020 by MiltonPusser (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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