XPUB HUB New Nodes

From XPUB & Lens-Based wiki

New nodes (machines) can be edited to the HUB Tinc network.

It is useful for machines (mostly Pis), without public IP addres, but which require public ssh or http access. As is the case of some students and Xpub projects

Steps to add a machine to the Tinc network

In the Pi

  • in your Pi's create a user with same username as in the sandbox. Keeping it the same as in the sandbox - will make things easier for us and gnd
  • add your public ssh key to your username in the Pi (same as mentioned) to ~/.ssh/authorized_keys

There is a trick to do this with

 `cat ~/.ssh/id_rsa.pub | ssh local.pi.IP.addr "cat >> ~/.ssh/authorized_keys"` 
  • install Tinc on the Pis Instructions can be found here Tinc, until the creation creation of the configuration dir:
sudo mkdir -p /usr/local/etc/tinc/
  • Add your chosen Node name and IP to HUB#IP_allocation
    • Student project IPs last number should have 3 digits, last one is Simon's 10.0.1.103, so you can start from there
  • Disable ssh to your pi with password (allow ssh key only), by:
    • ensuring you laptops ssh public key is in your pi ~/.ssh/authorized_keys:
cat  ~/.ssh/authorized_keys
    • ensuring you can login to the Pi with ssh key:
ssh username@pi.ip.add -i ~/.ssh/id_rsa

then:

  • edit /etc/ssh/sshd_config:
sudo nano /etc/ssh/sshd_config
  • and uncomment the line:
#PasswordAuthentication no

to:

PasswordAuthentication no
  • reload ssh: `sudo systemctl reload ssh`


In the XVM (xpub server)