deploy with capistrano using a pem file

Tyler Jones picture Tyler Jones · Oct 19, 2012 · Viewed 11.4k times · Source

We have a EC2 instance, and our capistrano setup requires ssh. To connect through ssh normally, I use a .pem file for connecting to the server. how do I utilize this .pem file when using capistrano to deploy?

Answer

Kinjal Dixit picture Kinjal Dixit · Sep 21, 2014

for capistrano 3 the syntax is somewhat different

set :pty, true

set :ssh_options, {
  forward_agent: true,
  auth_methods: ["publickey"],
  keys: ["/path/to/key.pem"]
}