Open Joe-Heffer-Shef opened 2 months ago
Instructions for update to pi...
add this line to /etc/rc.local /home/pi/bee_track/startupssh
run: sudo apt install autossh
create file: /home/pi/bee_track/startupssh, containing: sleep 30 autossh -f -R 5003:localhost:22 ohio@54.237.238.250 -i/home/pi/.ssh/ohio2.pem -N
chmod 755 /home/pi/bee_track/startupssh
(change port from 5003).
check .ssh folder exists
add ohio2.pem
run as root@raspberrypi:/etc# ssh -R 5003:localhost:22 ohio@54.237.238.250 -i/home/pi/.ssh/ohio2.pem
it will ask... The authenticity of host '54.237.238.250 (54.237.238.250)' can't be established. ECDSA key fingerprint is SHA256:kJl6prN6B0vkldUmBrjfuY72VReY6e+4F8FpD7n8iNk. Are you sure you want to continue connecting (yes/no)? yes
(this just stops it prompting in future -- to do figure out how to stop the prompt happening, so we avoid failing the autossh process)
How to add supplementary tunnels to access webpage and FLASK API:
start by getting to the server...
ssh 54.237.238.250 -lohio
on the server, connect to the pi...
ssh 127.0.0.1 -p5006 -lpi
run this on the pi...
ssh -N -R 8006:localhost:8000 ohio@54.237.238.250 -i/home/pi/.ssh/ohio2.pem &
can test on server with links 127.0.0.1:8006
ssh -N -R 6006:localhost:5000 ohio@54.237.238.250 -i/home/pi/.ssh/ohio2.pem &
can test on server with links 127.0.0.1:6006
then, on laptop
ssh -N -L 8006:localhost:8006 54.237.238.250 -lohio &
can test by opening a browser to http://127.0.0.1:8006/
then, on laptop again,
ssh -N -L 6006:localhost:6006 54.237.238.250 -lohio &
can test by opening a browser to http://127.0.0.1:6006/
then alter the port in the webpage, where it says url to API:
@Joe-Heffer-Shef Here's how we start the reverse ssh tunnel
We need a way to remotely access the OS of bee trackers that are deployed in the field in Ohio.
The options appear to be:
Reverse SSH tunnel access
Mike 29th March 2024
To-do list for SSH tunnel:
Ohio SSH gateway access
To-do list for Ohio gateway access