小编use*_*676的帖子

Elastic beanstalk 访问私有 git 仓库

我目前正在尝试使用 .ebextensions 命令向我的弹性 beanstalk 实例添加一个 ssh 密钥。

我存储的密钥在我的应用程序代码中,我尝试将它们复制到根 .ssh 文件夹,以便稍后在执行 git+ssh 克隆时访问它们

这是我的 .ebextensions 文件夹中的配置文件示例

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"
Run Code Online (Sandbox Code Playgroud)

问题是我在尝试克隆 repo 时遇到错误

Host key verification failed.
Run Code Online (Sandbox Code Playgroud)

我尝试了多种尝试将主机添加到 known_hosts 文件的方法,但都没有奏效!

执行克隆的命令是 npm install 因为 repo 指向节点模块

ssh git node.js elastic-beanstalk

7
推荐指数
1
解决办法
2189
查看次数

标签 统计

elastic-beanstalk ×1

git ×1

node.js ×1

ssh ×1