Getting an error like this when you push to Heroku?
electricsheep:herokuapp look$ git push heroku master Received disconnect from 18.104.22.168: 2: Too many authentication failures for git fatal: The remote end hung up unexpectedly
If you like to create an ssh key for each server you use, you run this risk.
The reason is that unless you specify which key to use for a host, ssh-agent sends each key in turn until one works. However some server configure sshd to reject connections after too many attempted logins. For example, Dreamhost does this (see Dealing with SSH’s key spam problem for details). This is especially annoying if you weren’t even planning to use key-based authentication (as is the case on Heroku).
You can fix this by setting
IdentitiesOnly yes in your
~/.ssh/config file. You can do this on a host-by-host basis.
host foobar.dreamhost.com IdentitiesOnly yes
Heroku is a bit difficult to do this for because they don’t have a single IP address or domain (that I know of) you can configure this for.
As a workaround, clear your identities:
(Thanks to my friend McClain for his help with the