Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

We have an 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?

1 Answer

0 votes
by (44.3k points)

In deploy.rb set these configuration values:

default_run_options[:pty] = true

ssh_options[:forward_agent] = true

ssh_options[:auth_methods] = ["publickey"]

ssh_options[:keys] = ["/path/to/key.pem"]

For Capistrano 3 use:

set :pty, true

set :ssh_options, {

  forward_agent: true,

  auth_methods: %w[publickey],

  keys: %w[/path/to/key.pem]

}

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...