Capistrano deployment on AWS using PEM

If you're using Capistrano and AWS for your deployment, and you happen to be using a PEM file for your login, you'll be surprised when you do a test deploy and be requested for a password.

cap deploy:setup

All you need to do is to add these lines to your deploy.rb file.

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:auth_methods] = ["publickey"]
ssh_options[:keys] = ["/your-path/to/key.pem"]

Maricris Nonato

I turn tech ideas into websites using Ruby. I'm a budding Buddhist practitioner, passionate about health & fitness, and a cat fanatic!