ruby on rails - Deploying to ec2 instance failing when access GitHub private repo -


i set github account year ago, , generated new ssh key @ time (to push , pull github command line). few days ago spun new ec2 instance, , downloaded .pem file gave me ssh it. able ssh server through command line using .pem file.

i'm using capistrano deploy rails app, , running cap staging deploy:check. in deploy.rb file, have private repo git url, , in staging.rb file have set set ssh_options location of .pem file downloaded ec2 instance.

when command starts run, connecting server fine, when tries access git repo, git_askpass=/bin/echo git_ssh=/tmp/<app_name>/git-ssh.sh /usr/bin/env git ls-remote -h git@github.com:<username>/<app_name>.git, fails message:

permission denied (publickey). fatal: not read remote repository. 

been researching issue online, , i've gathered seems need same ssh both github , ec2 server. perhaps information incorrect...have been unsuccessful far.

would love advice issue. thank time.

if issue register public key github account, can convert pem ssh key:

openssl rsa -in myfile.pem -pubout > myfile.pub ssh-keygen -f myfile.pub -i -m pkcs8 

the first command in "openssl: how extract public key?".
second 1 in "convert pem key ssh-rsa format".

as op justin confirms:

i used puttygen convert .pem format github wanted...it prefixed ssh-rsa.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -