`autossh` re-establishes the tunnel without port forwarding
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I launched an autossh
tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.
What I did
- Created an
~/.ssh/config
and confirmed it's valid - Installed
autossh
and successfully started the tunnel defined in the above config - Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active
- Checked
netstat -tulpan
on both machines; waited a few minutes - Plugged the ethernet cable back into the router
What was expected to happen
autossh
re-establishes a working tunnel
What actually happened
autossh
re-established a tunnel, but when I tried connecting to it from the other end, it gave me:
Unable to communicate with âÂÂmy-hostâÂÂ. Make sure the remote computer is available and the firewall is not blocking screen sharing.
More info
After I took down the upstream internet connection, netstat
on both VPS and RPI respectively showed:
tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin
and
tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh
That is, same matching ports, and the status ESTABLISHED
, even though RPI no longer had internet. Also, netstat
on the VPS showed me the port I needed as being connectable (LISTEN
), although the tunnel was supposed to be offline.
Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.
Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):
tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin
tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin
And the RPI netstat
now looks like:
tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh
tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh
So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.
I've seen this but the solution appears to be based on the netstat
output, which in my case looks fine, but actually isn't working.
debian ssh ssh-tunneling autossh
add a comment |Â
up vote
0
down vote
favorite
I launched an autossh
tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.
What I did
- Created an
~/.ssh/config
and confirmed it's valid - Installed
autossh
and successfully started the tunnel defined in the above config - Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active
- Checked
netstat -tulpan
on both machines; waited a few minutes - Plugged the ethernet cable back into the router
What was expected to happen
autossh
re-establishes a working tunnel
What actually happened
autossh
re-established a tunnel, but when I tried connecting to it from the other end, it gave me:
Unable to communicate with âÂÂmy-hostâÂÂ. Make sure the remote computer is available and the firewall is not blocking screen sharing.
More info
After I took down the upstream internet connection, netstat
on both VPS and RPI respectively showed:
tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin
and
tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh
That is, same matching ports, and the status ESTABLISHED
, even though RPI no longer had internet. Also, netstat
on the VPS showed me the port I needed as being connectable (LISTEN
), although the tunnel was supposed to be offline.
Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.
Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):
tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin
tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin
And the RPI netstat
now looks like:
tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh
tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh
So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.
I've seen this but the solution appears to be based on the netstat
output, which in my case looks fine, but actually isn't working.
debian ssh ssh-tunneling autossh
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I launched an autossh
tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.
What I did
- Created an
~/.ssh/config
and confirmed it's valid - Installed
autossh
and successfully started the tunnel defined in the above config - Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active
- Checked
netstat -tulpan
on both machines; waited a few minutes - Plugged the ethernet cable back into the router
What was expected to happen
autossh
re-establishes a working tunnel
What actually happened
autossh
re-established a tunnel, but when I tried connecting to it from the other end, it gave me:
Unable to communicate with âÂÂmy-hostâÂÂ. Make sure the remote computer is available and the firewall is not blocking screen sharing.
More info
After I took down the upstream internet connection, netstat
on both VPS and RPI respectively showed:
tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin
and
tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh
That is, same matching ports, and the status ESTABLISHED
, even though RPI no longer had internet. Also, netstat
on the VPS showed me the port I needed as being connectable (LISTEN
), although the tunnel was supposed to be offline.
Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.
Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):
tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin
tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin
And the RPI netstat
now looks like:
tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh
tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh
So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.
I've seen this but the solution appears to be based on the netstat
output, which in my case looks fine, but actually isn't working.
debian ssh ssh-tunneling autossh
I launched an autossh
tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.
What I did
- Created an
~/.ssh/config
and confirmed it's valid - Installed
autossh
and successfully started the tunnel defined in the above config - Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active
- Checked
netstat -tulpan
on both machines; waited a few minutes - Plugged the ethernet cable back into the router
What was expected to happen
autossh
re-establishes a working tunnel
What actually happened
autossh
re-established a tunnel, but when I tried connecting to it from the other end, it gave me:
Unable to communicate with âÂÂmy-hostâÂÂ. Make sure the remote computer is available and the firewall is not blocking screen sharing.
More info
After I took down the upstream internet connection, netstat
on both VPS and RPI respectively showed:
tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin
and
tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh
That is, same matching ports, and the status ESTABLISHED
, even though RPI no longer had internet. Also, netstat
on the VPS showed me the port I needed as being connectable (LISTEN
), although the tunnel was supposed to be offline.
Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.
Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):
tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin
tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin
And the RPI netstat
now looks like:
tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh
tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh
So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.
I've seen this but the solution appears to be based on the netstat
output, which in my case looks fine, but actually isn't working.
debian ssh ssh-tunneling autossh
debian ssh ssh-tunneling autossh
edited Sep 7 at 10:05
Rui F Ribeiro
36.6k1271116
36.6k1271116
asked Aug 13 at 14:19
aexl
1255
1255
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462310%2fautossh-re-establishes-the-tunnel-without-port-forwarding%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password