Remote Access

From HiveTool
Revision as of 06:22, 22 May 2016 by Paul (talk | contribs)
Jump to: navigation, search

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!

On the 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 the target host's authorized_keys

cat .ssh/id_rsa.pub | ssh -pTARGET_PORT pi@TARGET_IP 'cat >> .ssh/authorized_keys'

where

TARGET_PORT is the target hosts port, if use, like 8022
TARGET_IP is the target hosts ip, like 192.168.254.12

Make hive_command.pl executable:

sudo chmod a+x hive_command.pl