Difference between revisions of "Remote Access"

From HiveTool
Jump to: navigation, search
Line 3: Line 3:
 
'''''NOTE THAT THIS WILL ONLY WORK IF YOU HAVE ACCESS TO THE HIVETOOL DATABASE!'''''
 
'''''NOTE THAT THIS WILL ONLY WORK IF YOU HAVE ACCESS TO THE HIVETOOL DATABASE!'''''
  
On the hive computer, as pi, generate the key:
+
Create an automatic login from pi@hive_computer to user@target_host
 +
 
 +
http://www.linuxproblem.org/art_9.html
 +
 
 +
On hive_computer, as pi, generate the key:
 
sudo ssh-keygen -t rsa
 
sudo ssh-keygen -t rsa
  
Line 28: Line 32:
 
  +-----------------+
 
  +-----------------+
  
append it to the target host's authorized_keys
+
append it to target_host's authorized_keys
 
  cat .ssh/id_rsa.pub | ssh -pTARGET_PORT pi@TARGET_IP 'cat >> .ssh/authorized_keys'
 
  cat .ssh/id_rsa.pub | ssh -pTARGET_PORT pi@TARGET_IP 'cat >> .ssh/authorized_keys'
 
where
 
where
  TARGET_PORT is the target hosts port, if use, like 8022
+
  TARGET_PORT is target_host's ssh port, if use, like 8022
  TARGET_IP is the target hosts ip, like 192.168.254.12
+
  TARGET_IP is target_hosts ip, like 192.168.254.12
  
 
Make hive_command.pl executable:
 
Make hive_command.pl executable:
 
  sudo chmod a+x hive_command.pl
 
  sudo chmod a+x hive_command.pl

Revision as of 17:42, 22 May 2016

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

http://www.linuxproblem.org/art_9.html

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'

where

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