Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having problems with SSH. I can't connect to anything; every connection hangs indefinitely at SSH2_MSG_SERVICE_ACCEPT RECEIVED. I'm on OSX 10.6.8.

I'm thinking that it's a problem with my SSH configuration, but I can't figure it out. I have the original openssh that came with os x installed in /usr/bin/, and a brewed installation in /usr/local/bin/. I'm using the homebrew one - is there possibly some conflict going on here?

Any ideas on solutions or what could be causing this? Here is my ssh_config:

 Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
   IdentityFile ~/.ssh/identity
   IdentityFile ~/.ssh/id_rsa
   IdentityFile ~/.ssh/id_dsa
   Port 22
#   Protocol 2,1
   Cipher 3des
   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
   MACs hmac-md5,hmac-sha1,,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
share|improve this question
So, you have a Mac running 10.6.8 that you're trying to use as an SSH client, but you see this hang, no matter what "ssh server" (host running sshd) you try to connect to. How many different ssh server hosts have you tried to connect to? What were they running? How did they have sshd configured? Your question almost makes it sound like you edited sshd_config on your ssh client machine and wondered why that didn't make a difference. sshd is the server side of ssh; it only matters on the machine you're connecting to, not the machine you're connecting from. – Spiff Oct 4 '13 at 0:03
no, i totally did edit my own sshd config file thinking it might somehow do i've tried to SSH to an EC2 instance, to heroku's git server, to my local university's SSH server, etc, getting the same error each time. I don't know what their sshd configurations are, but I've been able to connect to them in the past, so i'm pretty sure it's a problem with my client configuration. – user2594363 Oct 4 '13 at 0:37
Try using one of those "what is my IP" websites to see what the rest of the world sees as your IP address and hostname. If it doesn't give you a host name, your site may not have reverse-dns set up correctly. If it does give you a host name, use an external DNS lookup website to look up the IP address for that hostname, and make sure it points to your machine's public IP address. – Spiff Oct 4 '13 at 4:46
my hostname seems correct - shows up as "". DNS lookup of the hostname gave the correct IP address. – user2594363 Oct 4 '13 at 21:40
My connection also stopped at SSH2_MSG_SERVICE_ACCEPT -- turned out my ssh-agent wasn't started/properly initiated.… – Joel Purra Jul 25 '15 at 10:15

It's possible that the host(s) you're connecting to (the one(s) running the sshd server, not the one you're running the ssh client from), is hanging here as it tries—and then times out and fails—to do a reverse-DNS lookup of your ssh client machine's host name based on its IP address.

One workaround is to edit /etc/sshd_config on the sshd server machine, not your ssh client machine to set "UseDNS" to "no". (From the way you originally wrote your question, it sounded like you may have edited that file on your client, which wouldn't make a difference.)

Another solution would be to have your ISP (or whatever institution is responsible for your publicly-routable IP addresses) fix their reverse-DNS record for your IP address on their DNS name servers that are authoritative for the reverse-DNS records for that block of IP addresses. In other words, "make it so people can find your host name based on your IP address, and make sure the hostname they find maps back to your IP address".

share|improve this answer
i attached my ssh_config file, maybe something sticks out? – user2594363 Oct 4 '13 at 0:42
@user2594363 Nothing sticks out. It's pretty close to the system defaults. By the way, does the built-in ssh binary from /usr/bin have this same problem, or is this problem only with the Homebrew one? – Spiff Oct 4 '13 at 4:47
the built in binary has the same problem. – user2594363 Oct 4 '13 at 21:30
i also just tried using ssh-add -l to list identities, then ssh-add -D to delete all identities - both commands hung indefinitely and didn't do anything. – user2594363 Oct 4 '13 at 23:21
To check what you said, I edited '/etc/hosts' in the remote host, adding my hostname and my ip. It fixed the issue. Thanks! – JorgeeFG May 11 at 15:28

More information on this issue here:

Apparently this is a problem with the current version on Homebrew. (I've just run into it myself.)

share|improve this answer

I think Homebrew's libssh2 messes up Apple`s ssh binaries. Try:

brew uninstall --force libssh2. 
share|improve this answer
Can you please provide some evidences, examples for your claim? – Romeo Ninov Mar 16 at 7:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .