A collection of learnings, coding adventures and random thoughts about living life.

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"]