6 Replies Latest reply: Nov 15, 2013 10:11 AM by fundrot
thedayisyours Level 1 Level 1 (0 points)
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: keytype_fromname: unknown key type '-----BEGIN'
debug2: keytype_fromname: unknown key type 'Proc-Type:'
debug2: keytype_fromname: unknown key type 'DEK-Info:'
debug2: keytype_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: SSH2MSGKEXINIT sent
debug1: SSH2MSGKEXINIT received
debug2: kexparsekexinit: 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: kexparsekexinit: 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: kexparsekexinit: 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: kexparsekexinit: 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: kexparsekexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.co m,hmac-sha1-96,hmac-md5-96
debug2: kexparsekexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.co m,hmac-sha1-96,hmac-md5-96
debug2: kexparsekexinit: none,zlib@openssh.com,zlib
debug2: kexparsekexinit: none,zlib@openssh.com,zlib
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: firstkexfollows 0
debug2: kexparsekexinit: reserved 0
debug2: kexparsekexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-g roup1-sha1
debug2: kexparsekexinit: ssh-rsa,ssh-dss
debug2: kexparsekexinit: 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: kexparsekexinit: 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: kexparsekexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac- md5-96
debug2: kexparsekexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac- md5-96
debug2: kexparsekexinit: none,zlib@openssh.com
debug2: kexparsekexinit: none,zlib@openssh.com
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: firstkexfollows 0
debug2: kexparsekexinit: 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: SSH2MSG_KEX_DH_GEXREQUEST(1024<1024<8192) sent
debug1: expecting SSH2MSG_KEX_DH_GEXGROUP
debug2: dhgenkey: priv key bits set: 126/256
debug2: bits set: 505/1024
debug1: SSH2MSG_KEX_DH_GEXINIT sent
debug1: expecting SSH2MSG_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: sshrsaverify: signature correct
debug2: kexderivekeys
debug2: set_newkeys: mode 1
debug1: SSH2MSGNEWKEYS sent
debug1: expecting SSH2MSGNEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2MSGNEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2MSG_SERVICEREQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2MSG_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)
  • Linc Davis Level 10 Level 10 (172,995 points)
    +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'm confused. How is this different from what you're doing when it doesn't work?
  • thedayisyours Level 1 Level 1 (0 points)
    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
  • Linc Davis Level 10 Level 10 (172,995 points)
    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.
  • thedayisyours Level 1 Level 1 (0 points)
    Thanks for the advice, but I think I'll just let it work as it is, because I would have to re-install everything, which always is a hassle.

    Best,
    thedayisyours
  • shuo shi Level 1 Level 1 (0 points)

    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!!

  • fundrot Level 1 Level 1 (0 points)

    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