Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

ssh connections dropping

since upgrading to lion ssh connections constantly drop with:

Write failed: Broken pipe


this did not happen in snow leopard, nor does it happen on win7 pro in parralels

apple terminal, zoc, and securecrt all experience the same thing


did apple change an idle timeout setting or something?

MacBook Pro, Mac OS X (10.7)

Posted on Aug 16, 2011 6:55 AM

Reply
38 replies

Nov 19, 2011 8:35 AM in response to larrycz

After 1 day of testing I no longer experience this problem to such an obvious extent (so far it actually seems like it's fixed altogether). The net.inet.tcp.keepidle and net.inet.tcp.keepintvl variables were modified in /etc/sysctl.conf. Their values were extremely low. I don't know how this happened. The solution was to set these values to their default values net.inet.tcp.keepidle=7200000 and net.inet.tcp.keepintvl=75000 using the "sudo sysctl -w" command.

Nov 19, 2011 3:21 PM in response to larrycz

I do not have a /etc/sysctl.conf on my Lion nor my Snow Leopard system.


Are you saying that your /etc/sysctl.conf was changed?


Or that the default values for net.inet.tcp.keepidle and net.inet.tcp.keepintvl were too small without a /etc/sysctl.conf file.


I found I could examine my sysctl values using


sysctl -a | grep tcp.keep

net.inet.tcp.keepidle: 7200000

net.inet.tcp.keepintvl: 75000


NOTE: I get the same values for both Lion and Snow Leopard.


All I'm asking is how your system got different values. If you had a /etc/sysctl.conf file that got changed that would explain it.


No matter what, it would be useful for anyone experiencing ssh disconnects to check their net.inet.tcp.keepidle and net.inet.tcp.keepintvl values.

Dec 8, 2011 11:47 AM in response to blist

try this !!!


I copied the Terminal.app folder from /Applications/Utilities from a Macbook running Snow leopard or Leopard (dont remember which of two) and put it in my personal folder on OS Lion. Running this version of Terminal seems to be doing fine.


I am on ssh all day and the ssh connection would close on me every few hours.

I have been running the Snow Leopard version of Terminal for about half a day and no drops so far.


will update!!


amit

Dec 16, 2011 5:21 PM in response to blist

I see the same issue.


Changes that didn't help:

Installing latest Xquartz

Using iTerm instead of Terminal.app


Changes that seem to have helped

Using 'ssh -Y' rather than 'ssh -X'

Don't tunnel the X connection through the ssh link (i.e. set DISPLAY on remote machine and xhost+ locally)


Both modifications have security implications so use with care.

Jan 14, 2012 8:20 AM in response to blist

The changes mentioned towards the bottom of this page by subq seem to have fixed this issue for me:


http://subq.surfing.net/os-x-lion-terminal-ssh-tweaks


12 hours+ and the issue has not resurfaced. However, making these changes to your user's ssh config under your own account are more preferable due to future updates overwriting them if made in /private/etc/ssh_config.

Feb 23, 2012 12:04 PM in response to Cornelius58

Ditto with the re-install. I had to re-install Lion after a failed update to 10.7.3. Previously, I had consistent problems with an SSH connection locking up and later dumping with a broken pipe on some remote servers after sitting with no use for more than 10 minutes. Since then, the Dreamhost servers I connect to no longer exhibit this behavior. Connections to an EC2 instance on AWS, however, still has the same problem.


Furthermore, this was a clean re-install with cherry-picked files copies over via Migration Assistant and Time Machine (not a clean restore directly from TM).

Oct 5, 2012 11:02 PM in response to blist

I got same issue with my MacBook Pro but Mountain Lion, My iMac, My Mac Mini, My Mac Pro (mac pro is at my studio and iMac is my home office) I have gone to 10 different locations and on all 12 of my linux servers i got same issues, unless i am on my FreeSWITCH system and in CLI that will remain connected for days on end... 3-10 minutes at bash and i lose connection.

ssh connections dropping

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.