gpt4 book ai didi

amazon-web-services - packer 构建无法通过 ssh 连接到 aws 实例

转载 作者:行者123 更新时间:2023-12-02 13:48:42 27 4
gpt4 key购买 nike

以下配置将启动一个实例但无法连接它...但是相同的 key 、vpc-id、子网 ID 和安全组 ID 在测试厨房中工作没有问题。

{
"variables": {
"aws_access_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"aws_secret_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-146e2a7c",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-example {{timestamp}}",
"ssh_keypair_name": "xxx",
"ssh_private_key_file": "xxx.pem",
"vpc_id": "vpc-xxxxxxx",
"subnet_id": "subnet-xxxxxxx",
"security_group_id": "sg-xxxxxxx",
"associate_public_ip_address": "true"

}]
}

我收到以下调试错误:

2016/12/17 20:10:50 packer: 2016/12/17 20:10:50 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [publickey none], no supported methods remain
2016/12/17 20:10:50 packer: 2016/12/17 20:10:50 [DEBUG] Detected authentication error. Increasing handshake attempts.
2016/12/17 20:10:57 packer: 2016/12/17 20:10:57 [INFO] Attempting SSH connection...
2016/12/17 20:10:57 packer: 2016/12/17 20:10:57 reconnecting to TCP connection for SSH
2016/12/17 20:10:57 packer: 2016/12/17 20:10:57 handshaking with SSH
2016/12/17 20:10:59 packer: 2016/12/17 20:10:59 handshake error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2016/12/17 20:10:59 packer: 2016/12/17 20:10:59 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2016/12/17 20:10:59 ui error: ==> amazon-ebs: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2016/12/17 20:10:59 ui: ==> amazon-ebs: Terminating the source AWS instance...

鉴于这在没有额外变量的测试厨房中有效,我想知道我遗漏了什么?有什么想法吗?

最佳答案

问题是错误的默认用户名。

关于amazon-web-services - packer 构建无法通过 ssh 连接到 aws 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41205382/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com