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

ssh update - hang - debug1: SSH2_MSG_SERVICE_ACCEPT received

Hi all,

this is my first post to this forum, because I am facing the first problem I could not find any help for.

The issue is that I at some point had the apparently not very clever idea to update ssh to the latest version (OpenSSH_5.8p1, OpenSSL 0.9.8l 5 Nov 2009).

Now, whenever I want to connect to a remote server, the connection hangs, no matter which options, connection type or login mode I choose. When using verbose mode, the following output is generated (XXX stands for personal data):

OpenSSH_5.8p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /Volumes/Home/XXX/.ssh/config
debug1: Reading configuration data /usr/etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to XXX port 22.
debug1: Connection established.
debug2: key type_fromname: unknown key type '-----BEGIN'
debug2: key type_fromname: unknown key type 'Proc-Type:'
debug2: key type_fromname: unknown key type 'DEK-Info:'
debug2: key type_fromname: unknown key type '-----END'
debug1: identity file /Volumes/Home/XXX/.ssh/id_rsa type 1
debug1: identity file /Volumes/Home/XXX/.ssh/id_rsa-cert type -1
debug1: identity file /Volumes/Home/XXX/.ssh/id_dsa type -1
debug1: identity file /Volumes/Home/XXX/.ssh/id_dsa-cert type -1
debug1: identity file /Volumes/Home/XXX/.ssh/id_ecdsa type -1
debug1: identity file /Volumes/Home/XXX/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_4.2
debug1: match: OpenSSH_4.2 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2 MSGKEXINIT sent
debug1: SSH2 MSGKEXINIT received
debug2: kex parsekexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-e xchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,di ffie-hellman-group1-sha1
debug2: kex parsekexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-ni stp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2- nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@open ssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex parsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blow fish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex parsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blow fish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex parsekexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.co m,hmac-sha1-96,hmac-md5-96
debug2: kex parsekexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.co m,hmac-sha1-96,hmac-md5-96
debug2: kex parsekexinit: none,zlib@openssh.com,zlib
debug2: kex parsekexinit: none,zlib@openssh.com,zlib
debug2: kex parsekexinit:
debug2: kex parsekexinit:
debug2: kex parsekexinit: first kexfollows 0
debug2: kex parsekexinit: reserved 0
debug2: kex parsekexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-g roup1-sha1
debug2: kex parsekexinit: ssh-rsa,ssh-dss
debug2: kex parsekexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes1 92-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex parsekexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes1 92-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex parsekexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac- md5-96
debug2: kex parsekexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac- md5-96
debug2: kex parsekexinit: none,zlib@openssh.com
debug2: kex parsekexinit: none,zlib@openssh.com
debug2: kex parsekexinit:
debug2: kex parsekexinit:
debug2: kex parsekexinit: first kexfollows 0
debug2: kex parsekexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2 MSG_KEX_DH_GEXREQUEST(1024<1024<8192) sent
debug1: expecting SSH2 MSG_KEX_DH_GEXGROUP
debug2: dh genkey: priv key bits set: 126/256
debug2: bits set: 505/1024
debug1: SSH2 MSG_KEX_DH_GEXINIT sent
debug1: expecting SSH2 MSG_KEX_DH_GEXREPLY
debug1: Server host key: RSA ca:68:3b:50:76:eb:f1:b7:f3:b1:56:2d:39:28:0f:90
debug1: Host 'XXX' is known and matches the RSA host key.
debug1: Found key in /Volumes/Home/XXX/.ssh/known_hosts:2
Host key fingerprint is XXX
debug2: bits set: 528/1024
debug1: ssh rsaverify: signature correct
debug2: kex derivekeys
debug2: set_newkeys: mode 1
debug1: SSH2 MSGNEWKEYS sent
debug1: expecting SSH2 MSGNEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2 MSGNEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2 MSG_SERVICEREQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2 MSG_SERVICEACCEPT received

Then the process just hangs. I waited for almost an hour and nothing happened. The same happens no matter which server I connect to.

What surprises me is that the connection works without any problems when I login in the terminal, i.e. I open the terminal, execute "login" with my usual user data, and the ssh to the other machine.

I have already tried everything, even reinstalling ssh from the original SL-DVD, but to no avail. So any ideas will be greatly appreciated!

Best,
thedayisyours

MacBook, Mac OS X (10.6.7)

Posted on Apr 9, 2011 4:45 AM

Reply
6 replies

Apr 9, 2011 12:46 PM in response to Linc Davis

Well, it IS confusing. But I'll try to make myself clear.

It does not work (with the error message shown), when I launch the terminal and ssh to a remote server.

It works when I launch the terminal, execute the command "login" with my user name (i.e. the user name I have already logged in when starting my computer) and then execute "ssh".
So, as a workaround, I have defined an alias in .bash_profile which is "alias ssh='login -f Username ssh'", so that now I can ssh as ever.
But I am still curious about why this strange behaviour...

Best,
thedayisyours

Message was edited by: thedayisyours

Message was edited by: thedayisyours

Apr 9, 2011 1:11 PM in response to thedayisyours

I really don't know why that's happening, but it must be because you corrupted either your system or your shell initialization files. Please don't replace critical system binaries unless you know more than the Apple engineers who put them there. Restore your system and your shell files to their original state by whatever means you were planning to use if this hack didn't work, which it doesn't. That's all I can suggest.

Apr 25, 2011 2:03 AM in response to thedayisyours

I used mac port to install openssh, and then rm -rf /usr/bin/ssh*, the biggest problem is I modified /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist... replaced /usr/bin/ssh-agent to /opt/local/bin/ssh-agent... so when I use ssh to login my server, it hanged right there.


I don't know where is wrong... so I copy all ssh* from my friend's mac back to /usr/bin and restore my org.openbsd.ssh-agent.plist, do a restart, and everything is ok...


so I think it's fair to say " u corrupted either your system or your shell initialization files", if you remember what did u modified, try to change it back~ A litter bit risky of course!!

Nov 15, 2013 10:11 AM in response to shuo shi

When upgrading using mac ports (for Mavericks), edit

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/op enssh/Portfile

and add


patchfiles-append DVG-4748610+4897588_ssh-agent_via_launchd.patch


after ~ line 49 (patchfiles launchd.patch)


also replace


configure.cppflags-append -fno-builtin


with


configure.cppflags-append "-fno-builtin -D__APPLE_LAUNCHD__"


if open ssh is already installed (with mac ports), run


port uninstall openssh


then


port install openssh


All of this is based on: http://pastebin.com/yg074cbm

ssh update - hang - debug1: SSH2_MSG_SERVICE_ACCEPT received

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