How do I troubleshoot ssh tunnels disconnection?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using SSH tunnels launched via autossh at boot on a device installed at remote locations. Up to now everything was working fine but yesterday the connection partly went down and autossh wouldn't do its thing. And I would love to figure out what happened to prevent it ever happening again. I have to deal with SLAs and all.
Here are the details:
THE SETUP
Remote site:
-Raspbian on a raspberry pi (debian wheezy)
-Autossh running at boot connects to our server and establishes 3 ssh tunnels
Tunnel 1: regular tunnel forwarding a local port on the raspberry pi to a server in our office
Tunnel 2: reverse tunnel opens a port on our server pointing to a device on the remote network
Tunnel 3: reverse tunnel opens a port from our server's loopback (127.0.0.1) adapter pointing to the ssh port of the raspberry pi on its loopback adapter.
So basically with this setup I have to ssh in our server from which I can ssh into each remote devices.
SSH Server:
-Debian Wheezy
-No firewall/iptables on the server, we use another box for this
THE PROBLEM
Both reverse tunnels (tunnels 2 and 3) stopped working. The output of
sudo netstat -atp | grep ssh
Showed that the only port still opened was for tunnel # 1
When I killed the ssh process on the server for tunnel # 1 autossh did its thing and all tunnels were reconnected but I would prefer if I didn't have to do this.
Is it normal behavior for autossh? Does autossh have issues monitoring reverse tunnels?
SYSLOG from the remote device
Sep 7 06:25:06 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 10:24:57 remote_hostname autossh[1428]: starting ssh (count 2)
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh child pid is 24161
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 16:53:53 remote_hostname autossh[1428]: starting ssh (count 3)
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh child pid is 30541
Sep 9 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
ssh ssh-tunneling sshd syslog troubleshooting
add a comment |
I am using SSH tunnels launched via autossh at boot on a device installed at remote locations. Up to now everything was working fine but yesterday the connection partly went down and autossh wouldn't do its thing. And I would love to figure out what happened to prevent it ever happening again. I have to deal with SLAs and all.
Here are the details:
THE SETUP
Remote site:
-Raspbian on a raspberry pi (debian wheezy)
-Autossh running at boot connects to our server and establishes 3 ssh tunnels
Tunnel 1: regular tunnel forwarding a local port on the raspberry pi to a server in our office
Tunnel 2: reverse tunnel opens a port on our server pointing to a device on the remote network
Tunnel 3: reverse tunnel opens a port from our server's loopback (127.0.0.1) adapter pointing to the ssh port of the raspberry pi on its loopback adapter.
So basically with this setup I have to ssh in our server from which I can ssh into each remote devices.
SSH Server:
-Debian Wheezy
-No firewall/iptables on the server, we use another box for this
THE PROBLEM
Both reverse tunnels (tunnels 2 and 3) stopped working. The output of
sudo netstat -atp | grep ssh
Showed that the only port still opened was for tunnel # 1
When I killed the ssh process on the server for tunnel # 1 autossh did its thing and all tunnels were reconnected but I would prefer if I didn't have to do this.
Is it normal behavior for autossh? Does autossh have issues monitoring reverse tunnels?
SYSLOG from the remote device
Sep 7 06:25:06 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 10:24:57 remote_hostname autossh[1428]: starting ssh (count 2)
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh child pid is 24161
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 16:53:53 remote_hostname autossh[1428]: starting ssh (count 3)
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh child pid is 30541
Sep 9 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
ssh ssh-tunneling sshd syslog troubleshooting
1
Does it give more insight to runssh
with options-v
,-vv
, or-vvv
?
– Volker Siegel
Sep 9 '14 at 15:39
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50
add a comment |
I am using SSH tunnels launched via autossh at boot on a device installed at remote locations. Up to now everything was working fine but yesterday the connection partly went down and autossh wouldn't do its thing. And I would love to figure out what happened to prevent it ever happening again. I have to deal with SLAs and all.
Here are the details:
THE SETUP
Remote site:
-Raspbian on a raspberry pi (debian wheezy)
-Autossh running at boot connects to our server and establishes 3 ssh tunnels
Tunnel 1: regular tunnel forwarding a local port on the raspberry pi to a server in our office
Tunnel 2: reverse tunnel opens a port on our server pointing to a device on the remote network
Tunnel 3: reverse tunnel opens a port from our server's loopback (127.0.0.1) adapter pointing to the ssh port of the raspberry pi on its loopback adapter.
So basically with this setup I have to ssh in our server from which I can ssh into each remote devices.
SSH Server:
-Debian Wheezy
-No firewall/iptables on the server, we use another box for this
THE PROBLEM
Both reverse tunnels (tunnels 2 and 3) stopped working. The output of
sudo netstat -atp | grep ssh
Showed that the only port still opened was for tunnel # 1
When I killed the ssh process on the server for tunnel # 1 autossh did its thing and all tunnels were reconnected but I would prefer if I didn't have to do this.
Is it normal behavior for autossh? Does autossh have issues monitoring reverse tunnels?
SYSLOG from the remote device
Sep 7 06:25:06 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 10:24:57 remote_hostname autossh[1428]: starting ssh (count 2)
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh child pid is 24161
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 16:53:53 remote_hostname autossh[1428]: starting ssh (count 3)
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh child pid is 30541
Sep 9 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
ssh ssh-tunneling sshd syslog troubleshooting
I am using SSH tunnels launched via autossh at boot on a device installed at remote locations. Up to now everything was working fine but yesterday the connection partly went down and autossh wouldn't do its thing. And I would love to figure out what happened to prevent it ever happening again. I have to deal with SLAs and all.
Here are the details:
THE SETUP
Remote site:
-Raspbian on a raspberry pi (debian wheezy)
-Autossh running at boot connects to our server and establishes 3 ssh tunnels
Tunnel 1: regular tunnel forwarding a local port on the raspberry pi to a server in our office
Tunnel 2: reverse tunnel opens a port on our server pointing to a device on the remote network
Tunnel 3: reverse tunnel opens a port from our server's loopback (127.0.0.1) adapter pointing to the ssh port of the raspberry pi on its loopback adapter.
So basically with this setup I have to ssh in our server from which I can ssh into each remote devices.
SSH Server:
-Debian Wheezy
-No firewall/iptables on the server, we use another box for this
THE PROBLEM
Both reverse tunnels (tunnels 2 and 3) stopped working. The output of
sudo netstat -atp | grep ssh
Showed that the only port still opened was for tunnel # 1
When I killed the ssh process on the server for tunnel # 1 autossh did its thing and all tunnels were reconnected but I would prefer if I didn't have to do this.
Is it normal behavior for autossh? Does autossh have issues monitoring reverse tunnels?
SYSLOG from the remote device
Sep 7 06:25:06 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 10:24:57 remote_hostname autossh[1428]: starting ssh (count 2)
Sep 8 10:24:57 remote_hostname autossh[1428]: ssh child pid is 24161
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh exited with error status 255; restarting ssh
Sep 8 16:53:53 remote_hostname autossh[1428]: starting ssh (count 3)
Sep 8 16:53:53 remote_hostname autossh[1428]: ssh child pid is 30541
Sep 9 06:25:05 remote_hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1661" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
ssh ssh-tunneling sshd syslog troubleshooting
ssh ssh-tunneling sshd syslog troubleshooting
edited Mar 10 at 4:34
Rui F Ribeiro
42k1483142
42k1483142
asked Sep 9 '14 at 15:03
TCZ8TCZ8
5443820
5443820
1
Does it give more insight to runssh
with options-v
,-vv
, or-vvv
?
– Volker Siegel
Sep 9 '14 at 15:39
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50
add a comment |
1
Does it give more insight to runssh
with options-v
,-vv
, or-vvv
?
– Volker Siegel
Sep 9 '14 at 15:39
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50
1
1
Does it give more insight to run
ssh
with options -v
, -vv
, or -vvv
?– Volker Siegel
Sep 9 '14 at 15:39
Does it give more insight to run
ssh
with options -v
, -vv
, or -vvv
?– Volker Siegel
Sep 9 '14 at 15:39
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50
add a comment |
1 Answer
1
active
oldest
votes
You are using various ways to create log output,
but do not mention the most important ones:
The command ssh
itself has a "verbose" option -v
.
And more interesting, it also has a "verry verbose" option -vv
.
Oh, and "verry verry verbose", -vvv
, which may actually be too verbose!
Does it give more insight to run ssh with options -v, -vv, or -vvv?
Showing how much verbosity the options enable:
$ ssh -v localhost true |& wc -l
56
$ ssh -vv localhost true |& wc -l
122
$ ssh -vvv localhost true |& wc -l
282
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f154614%2fhow-do-i-troubleshoot-ssh-tunnels-disconnection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You are using various ways to create log output,
but do not mention the most important ones:
The command ssh
itself has a "verbose" option -v
.
And more interesting, it also has a "verry verbose" option -vv
.
Oh, and "verry verry verbose", -vvv
, which may actually be too verbose!
Does it give more insight to run ssh with options -v, -vv, or -vvv?
Showing how much verbosity the options enable:
$ ssh -v localhost true |& wc -l
56
$ ssh -vv localhost true |& wc -l
122
$ ssh -vvv localhost true |& wc -l
282
add a comment |
You are using various ways to create log output,
but do not mention the most important ones:
The command ssh
itself has a "verbose" option -v
.
And more interesting, it also has a "verry verbose" option -vv
.
Oh, and "verry verry verbose", -vvv
, which may actually be too verbose!
Does it give more insight to run ssh with options -v, -vv, or -vvv?
Showing how much verbosity the options enable:
$ ssh -v localhost true |& wc -l
56
$ ssh -vv localhost true |& wc -l
122
$ ssh -vvv localhost true |& wc -l
282
add a comment |
You are using various ways to create log output,
but do not mention the most important ones:
The command ssh
itself has a "verbose" option -v
.
And more interesting, it also has a "verry verbose" option -vv
.
Oh, and "verry verry verbose", -vvv
, which may actually be too verbose!
Does it give more insight to run ssh with options -v, -vv, or -vvv?
Showing how much verbosity the options enable:
$ ssh -v localhost true |& wc -l
56
$ ssh -vv localhost true |& wc -l
122
$ ssh -vvv localhost true |& wc -l
282
You are using various ways to create log output,
but do not mention the most important ones:
The command ssh
itself has a "verbose" option -v
.
And more interesting, it also has a "verry verbose" option -vv
.
Oh, and "verry verry verbose", -vvv
, which may actually be too verbose!
Does it give more insight to run ssh with options -v, -vv, or -vvv?
Showing how much verbosity the options enable:
$ ssh -v localhost true |& wc -l
56
$ ssh -vv localhost true |& wc -l
122
$ ssh -vvv localhost true |& wc -l
282
edited Sep 15 '14 at 1:01
answered Sep 10 '14 at 12:49
Volker SiegelVolker Siegel
11.1k33361
11.1k33361
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f154614%2fhow-do-i-troubleshoot-ssh-tunnels-disconnection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Does it give more insight to run
ssh
with options-v
,-vv
, or-vvv
?– Volker Siegel
Sep 9 '14 at 15:39
Ha ha ha... I completely forgot that autossh is just a wrapper for ssh. I checked it's help dialog for debuging option and forgot to check ssh itself. Thank you!
– TCZ8
Sep 10 '14 at 12:43
So I'll make it an answer :)
– Volker Siegel
Sep 10 '14 at 12:45
Please do! My company just stopped supplying us with free coffee... I guess my ADD brain is having issues coping hehehe thanks again!
– TCZ8
Sep 10 '14 at 12:47
Ha, ask my brain...
– Volker Siegel
Sep 10 '14 at 12:50