【问题标题】:Packer --debug produces the wrong ssh keypairPacker --debug 产生错误的 ssh 密钥对
【发布时间】:2017-10-30 20:38:49
【问题描述】:

我正在尝试通过调试运行打包程序,但无法通过 ssh 进入我的实例。每次尝试都会导致此错误:

$ ssh -i ./ec2_amazon-ebs.pem centos@1.2.3.4 -vvvv
ssh_exchange_identification: read: Connection reset by peer

我尝试通过生成一个新的公钥来对照打包程序密钥对检查这一点:

ssh-keygen -y -f ./ec2_amazon-ebs.pem

然后我将它作为密钥对添加到 aws 中,然后比较指纹。它们是不同的,因此打包程序似乎要么在 aws 中设置了错误的密钥,要么给了我不正确的私钥。

【问题讨论】:

标签: amazon-ec2 ssh packer


【解决方案1】:

我发现一个解决方案是生成另一个 ssh 密钥 (packer-testing-a.pem),然后将其设置为要使用的密钥对:

"builders": [
  {
    ....
    "ssh_keypair_name": "packer-testing-a",
    "ssh_private_key_file": "./packer-testing-a.pem",
    ....
  }
]

这确实违背了运行调试和创建本地密钥对的目的。

【讨论】:

    猜你喜欢
    • 2014-01-04
    • 1970-01-01
    • 1970-01-01
    • 2018-07-26
    • 1970-01-01
    • 2013-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多