Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Can you reproduce my problem w. dropped SSH connections?

Can you reproduce my problem w. dropped SSH connections?
Thread Tools
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 11, 2009, 05:48 PM
 
Hello,

I'm wondering if any of you have any sort of experience that resembles mine...

Periodically and randomly I have to reconnect to my network shares via SSH and SSH back into the servers I'm connected to in my terminal. Any files I have open via my SSHfs mount will become unavailable, and the Finder will eventually unmount my volume or else I'll be forced to force eject the volume. At the same time, like I said, all of my remote terminal sessions will become unresponsive until I reconnect to them. If I keep up some sort of activity, I can remain connected to both.

I've tried running a constant ping of the server I'm connected to during this time and I'm showing little to no packet loss. Even with a dropped packet or two, it should still reconnect gracefully, it has for years prior to when this started.

What's messing with my head is that this seemed to start at roughly the same time as my getting a new Mac running Snow Leopard and a new router, which came shortly after. I'm not completely confident in my memory of whether I was experiencing this problem in between, the two variables are unfortunately kind of a blur right now. If I had to choose I would say that my getting the router was when this started to happen, but this doesn't explain why my ping test seems to work - network connectivity seems okay.

It's gotten frustrating enough that I'm ready to try some troubleshooting steps which will include trying this in another account, seeing if I can reproduce this in Leopard, and possibly seeing if this happens on another network. Before I do all of this though, I thought I would see if any of this rings any bells to any of you - possibly fast track this for me
     
Camelot
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Nov 21, 2009, 01:46 AM
 
Sounds like a classic keepalive problem to me.

By default, SSH will drop a connection after a period of inactivity. You can change this by telling it to maintain a keepalive with the server - a periodic heartbeat that tickles the connection and keeps it alive.

You should edit /etc/ssh_config and add the line:

> ServerAliveInterval 10

This will send a heartbeat every 10 seconds. If there's no reply after three heartbeats the connection will drop.
Gods don't kill people - people with Gods kill people.
     
besson3c  (op)
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 21, 2009, 11:27 AM
 
Originally Posted by Camelot View Post
Sounds like a classic keepalive problem to me.

By default, SSH will drop a connection after a period of inactivity. You can change this by telling it to maintain a keepalive with the server - a periodic heartbeat that tickles the connection and keeps it alive.

You should edit /etc/ssh_config and add the line:

> ServerAliveInterval 10

This will send a heartbeat every 10 seconds. If there's no reply after three heartbeats the connection will drop.

Thanks, I've added this! The OpenSSH version in Snow Leopard:

OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009

If this works I'll be wondering if some new default options are preset in some version of OpenSSH between the Leopard version (which I'll check on) and 5.2p1?
     
besson3c  (op)
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 23, 2009, 02:30 PM
 
It looks like this config file addition may have helped some, but the problem still persists much to my chagrin.

I'll keep trying stuff when I have the time... Thanks for your help!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:29 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,