Fork me on GitHub

Using Capistrano with EC2

17 December 2008

Capistrano has made it somewhat difficult to use cap with ec2. It has long been known that capistrano is borked when using EC2 because it requires the public key.

The work-around has been to download the public key from EC2 before running capistrano, a very ugly solution indeed. Well, after digging into the net-ssh source, it’s obvious that the public key was only used to hold identities in a hash. Because net/ssh uses ruby’s openssl library, we can call the public key to be generated from the private key, rather than requiring it from the user!

So, without further ado, no longer do you need to snatch up the public key from your EC2 instance. The fork is located at: http://github.com/auser/net-ssh/tree/master