Elastic beanstalk access private git repo
- by user221676
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