This will allow remote access to the hive computer without opening any ports on the router using reverse IP tunneling.
NOTE THAT THIS WILL ONLY WORK IF YOU HAVE ACCESS TO THE HIVETOOL DATABASE!
Create an automatic login from pi@hive_computer to user@target_host
On hive_computer, as pi, generate the key: sudo ssh-keygen -t rsa
# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: d9:2e:40:2d:59:b1:6e:f2:08:7e:6a:3e:96:2e:bf:04 root@NAPAPi5 The key's randomart image is: +---[RSA 2048]----+ | o. | | + . | | + o | | . o o | | E . o S . | | o . * . | | o.o o . | | ..=o . | | B*o | +-----------------+
append it to target_host's authorized_keys
cat .ssh/id_rsa.pub | ssh -pTARGET_PORT pi@TARGET_IP 'cat >> .ssh/authorized_keys'
TARGET_PORT is target_host's ssh port, if use, like 8022 TARGET_IP is target_hosts ip, like 192.168.254.12
Make hive_command.pl executable:
sudo chmod a+x hive_command.pl