0
다음 구성은 인스턴스를 회전 시키지만 연결에 실패합니다 ...하지만 동일한 키, vpc-id, 서브넷 ID 및 보안 그룹 ID는 문제없이 테스트 주방에서 작동합니다.패커 빌드는 aws 인스턴스로 SSH 할 수 없습니다.
{
"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...
이는 내가 무엇을 누락 궁금하네요 별도의 변수를 테스트 부엌에서 작동을 감안할 때? 어떤 아이디어?
동일한 SSH 공개 키로 ec2 인스턴스를 부팅하셨습니까? 인스턴스에 잘못된 공개 키를 넣을 가능성은 없습니까? 이것이 보통 의미하는 바입니다. –
문제가 해결되었습니다 - 기본 사용자 이름이 잘못되었습니다 :) – TyMac
@TyMac 그러면 자신의 질문에 답을하고 동의 한 것으로 표시해야합니다. –