Elastic beanstalk access private git repo

Posted by user221676 on Server Fault See other posts from Server Fault or by user221676
Published on 2014-05-28T13:48:01Z Indexed on 2014/05/30 9:30 UTC
Read the original article Hit count: 279

Filed under:
|
|
|

I am trying to currently add an ssh key to my elastic beanstalk instances using .ebextensions commands.

The keys I have stored are in my application code and I try to copy them to the root .ssh folder so I can access them when doing a git+ssh clone later

here is an example of the config file in my .ebextensions folder

packages:
  yum:
    git: []

container_commands:
    01-move-ssh-keys:
        command: "cp .ssh/* ~root/.ssh/; chmod 400 ~root/.ssh/tca_read_rsa; chmod 400 ~root/.ssh/tca_read_rsa.pub; chmod 644 ~root/.ssh/known_hosts;"
    02-add-ssh-keys:
        command: "ssh-add ~root/.ssh/tca_read_rsa"

the problem is that I get is an error when attempting to clone the repo

Host key verification failed.

I have tried many ways of try to add the host to the known_hosts file but none have worked!

The command that is doing the clone is npm install as the repo points to a node module

© Server Fault or respective owner

Related posts about ssh

Related posts about git