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.

Broken SSH client on Mavericks

I've read countless posts on broken SSH servers since the upgrade to Mavericks, but I'm having an issue with a broken SSH client. Every time I try to SSH to a remote server, after I type in my password, the prompt just hangs and I just see "Write failed: broken pipe".


I've found many alleged solutions that seem to indicate there are workaround involving decrypting and reincrypting keys and such, but these solutions seem to require using an encryption method that does not allow passwordless keys to work. So I've tried them anyway, using passwords for my new keys, and it still doesn't work. These are steps I used to try and fix it:


$ cd ~/.ssh
$ cp id_rsa id_rsa.bck
$ openssl rsa -in id_rsa -out id_rsa
$ openssl rsa -in id_rsa -aes256 -out id_rsa
$ chmod 0600 id_rsa
$ ssh-keygen -y -f id_rsa > id_rsa.pub


I still get "Write failed: broken pipe". I've tried playing with timeout settings and nothing's working.


Before I upgraded, I had zero problems with SSH whatsoever. All of my co-workers are having the same problem, which has gone uncorrected for weeks and it is hampering my work. How could a problem like this go undetected and ignored? We need a fix for this ASAP. This is crazy.

iMac, OS X Mavericks (10.9)

Posted on Nov 26, 2013 8:02 AM

Reply
38 replies

May 15, 2014 8:23 AM in response to TJN93

A coworker of mine actually found the solution here: http://askubuntu.com/questions/344863/ssh-new-connection-begins-to-hang-not-reje ct-or-terminate-after-a-day-or-so-on


It uses netcat to get around a problem some NAT routers apparently have with the TOC field in the IP datagram. I'm still not sure what changed in Mavericks to prevent this from working with those routers. I haven't figured out if there's an actual fix to the problem, but this workaround does the trick for me.

May 15, 2014 9:47 AM in response to etresoft

etresoft, you really haven't been helpful AT ALL, the entire thread you have just disregarded what anyone has had to say blaming them for their problems and that it has nothing to do with the OS.


Well, it is because of the OS. I didn't have the problem before Mavericks.. upgraded to Mavericks, problem.


How on earth you are level 7 I do not know, with that pesimistic attitude I'm suprised you actually manage to help people.

May 24, 2014 6:05 AM in response to impossibleplanet

impossibleplanet wrote:


Adding the following to ~/.ssh/config is the only thing that has worked for me:


ProxyCommand nc %h %p

This is perfect. I understand now what the problem. As I mentioned in an earlier post that when I tried to connect via my WiFi Router, I ran into this error, but everything works normally when I use my WiFi hotspot on phone. My router has few extra hops (checked via traceroute) that caused the timeout.

It works on all my Mac OS X Mavericks devices.


Thanks a lot for sharing this. It still seems ike an isolated issue on the openssh/mac os x

Nov 5, 2014 1:19 PM in response to impossibleplanet

This discussion started in November 2013. I'm just now reading this in November 2014 because I started to experience the exact same symptoms as "impossibleplanet". I really must applaud "impossibleplanet". Despite snarky, nearly useless responses from "etresoft" he remained persistent and resolved the issue. Unfortunately, it took him and his co-workers seven(!) months, from November 2013 to May 2014.


For me, I've followed the recommendation from "impossibleplanet" but my problems persist.


It should be noted that I successfully SSHed from the same client (Mac OS) to the same server (Cent OS 6.5) nearly every day for many months. It just suddenly stopped working a few days ago. Once it stopped working, I tried from a different network, and was successful. So, it works from one network but not the other. When it fails, I get a password prompt followed by a "Authenticated" message (in debug mode), but the session just hangs after that (I never get logged-in).


The following is my ~/.ssh/config file:

TCPKeepAlive yes

ServerAliveInterval 5

ProxyCommand nc %h %p


My client machine is Mac OS 10.9.5, which includes the following ssh/openssh:

$ssh -V

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011


This is the version of OpenSSH that comes pre-installed on Mac OS 10.9.5. Should I upgrade it?


For reference, here is that portion of my SSH session AFTER successfully entering a valid password (I've replaced my IP address with XX.XX.XX.XX)

Authenticated to [XX.XX.XX.XX]:22.

debug1: channel 0: new [client-session]

debug3: ssh_session2_open: channel_new: 0

debug2: channel 0: send open

debug1: Requesting no-more-sessions@openssh.com

debug1: Entering interactive session.

debug2: callback start

debug2: fd 3 setting TCP_NODELAY

debug3: packet_set_tos: set IP_TOS 0x10

debug2: client_session2_setup: id 0

debug2: channel 0: request pty-req confirm 1

debug1: Sending environment.

debug3: Ignored env TERM_PROGRAM

debug3: Ignored env TERM

debug3: Ignored env SHELL

debug3: Ignored env TMPDIR

debug3: Ignored env Apple_PubSub_Socket_Render

debug3: Ignored env USER

debug3: Ignored env COMMAND_MODE

debug3: Ignored env SSH_AUTH_SOCK

debug3: Ignored env __CF_USER_TEXT_ENCODING

debug3: Ignored env __CHECKFIX1436934

debug3: Ignored env PATH

debug3: Ignored env PWD

debug1: Sending env LANG = en_US.UTF-8

debug2: channel 0: request env confirm 0

debug3: Ignored env SHLVL

debug3: Ignored env COLORFGBG

debug3: Ignored env HOME

debug3: Ignored env LOGNAME

debug3: Ignored env SECURITYSESSIONID

debug3: Ignored env _

debug2: channel 0: request shell confirm 1

debug2: callback done

debug2: channel 0: open confirm rwindow 0 rmax 32768

After the last line, it just hangs for a minute or two, and then times-out.


Any help is greatly appreciated!

Broken SSH client on Mavericks

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