Hello everyone!
I have a couple of 'reverse ssh' questions... and although not FreeBSD (or *BSD) specific, to be honest, this forum is my go-to place.
I always get helpful answers and discussions here... and directed to the correct source of information if need be.
As you know, I am a n00b to all of this... so I am still learning.
I have been creating a reverse ssh tunnel for two days now... with mixed results.
My setup:
Small Raspberry Pi running Raspian (linux).
Web server running CentOS (linux).
(I would like to migrate everything to FreeBSD in the future... yet at the moment, if I attempt that, I will break it seriously).
The list of processes that occur will be written below in a 'time line'.
Not sure if I am doing the correct things in the correct order!
0- Already created key files for the ssh connections, and positive I can ssh into the web server with the key file
1- from the rPi, I can manually create the reverse ssh tunnel with this line:
Once created, it works fine.
I can then ssh into the web server, and ssh back into the rPi with this line
My problem arises when I leave the connection:
Leave it either:
0- not doing anything for hours
1- on the rPi, hit Ctrl - x and close that command off (the reverse ssh command)
Once either of those happens, if I log back into the web server, and try to connect to the rPi via
It refuses the connection.
When I close the connection on the rPi with Ctrl -x, I understand.
Yet from not doing anything for hours... I would reckon it timed out.
What can I do to keep it alive?
Or any suggestions different altogether?
I am reading now into autossh, which looks promising.
And here is the page from where I started with this: Raspberry Pi: Phoning home using a reverse ssh tunnel
Thank you!!
AJ
I have a couple of 'reverse ssh' questions... and although not FreeBSD (or *BSD) specific, to be honest, this forum is my go-to place.
I always get helpful answers and discussions here... and directed to the correct source of information if need be.
As you know, I am a n00b to all of this... so I am still learning.
I have been creating a reverse ssh tunnel for two days now... with mixed results.
My setup:
Small Raspberry Pi running Raspian (linux).
Web server running CentOS (linux).
(I would like to migrate everything to FreeBSD in the future... yet at the moment, if I attempt that, I will break it seriously).
The list of processes that occur will be written below in a 'time line'.
Not sure if I am doing the correct things in the correct order!
0- Already created key files for the ssh connections, and positive I can ssh into the web server with the key file
1- from the rPi, I can manually create the reverse ssh tunnel with this line:
ssh -N -R 1234:localhost:22 USER@webserverOnce created, it works fine.
I can then ssh into the web server, and ssh back into the rPi with this line
ssh -l USER -p 1234 localhostMy problem arises when I leave the connection:
Leave it either:
0- not doing anything for hours
1- on the rPi, hit Ctrl - x and close that command off (the reverse ssh command)
Once either of those happens, if I log back into the web server, and try to connect to the rPi via
ssh -l USER -p 1234 localhostIt refuses the connection.
When I close the connection on the rPi with Ctrl -x, I understand.
Yet from not doing anything for hours... I would reckon it timed out.
What can I do to keep it alive?
Or any suggestions different altogether?
I am reading now into autossh, which looks promising.
And here is the page from where I started with this: Raspberry Pi: Phoning home using a reverse ssh tunnel
Thank you!!
AJ