Posted by Luke Francl
on Sunday, January 31
Getting an error like this when you push to Heroku?
electricsheep:herokuapp look$ git push heroku master
Received disconnect from 75.101.163.44: 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:
ssh-add -D
(Thanks to my friend McClain for his help with the ssh-add command.)
Posted by Luke Francl
on Tuesday, August 28
Back in my PHP/MySQL days I used to be quite the MySQL console jockey. I used it for all kinds of stuff. Then I got a new job, moved to DB2 and thankfully forgot as much as I could about MySQL. Now I’m doing Rails and working with MySQL again. But these days I use CocoaMySQL for nosing around the database on my local machines.
On remote servers, I was still using the console, but I recently found this trick which allows you to open up CocoaMySQL on a remote database using an SSH tunnel. The database doesn’t have to be configured to accept connections from outside of localhost.
Here’s how it works.
First, create an SSH tunnel.
ssh -L 8888:example.com:3306 user@example.com
Here I’m connecting the free port 8888 on my local machine to 3306 (the MySQL port) on the remote server, logging in as user.
Then configure CocoaMySQL to use the tunnel. Set the host to 127.0.0.1 and the port to 8888. The user, database, and password will be that of your remote server.

(There’s a section in the config screen to use an SSH tunnel, which I think is supposed to create the tunnel automatically, but I wasn’t able to get that to work.)
I’ve found this tip useful in my work. Hopefully you will too!
Posted by Casey
on Thursday, May 10
I recently ran into an issue after upgrading my gems in which capistrano would fail during the SSH known_hosts verification. I’m on OS X with capistrano 1.4.1, net-ssh 1.1.0 and can manually SSH to the deploy machine. A little googling turned up an easy work around for the problem. Simply add the following line to your deploy.rb and capistrano will skip the known_hosts verification.
|
ssh_options[:paranoid] = false |