ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

404 views
Skip to first unread message

Suryaraj Timsina

unread,
Dec 16, 2022, 10:29:18 PM12/16/22
to Packer
I am getting following error while creating a new AMI by running some scripts on the existing old AMI. The possible problem I can guess is,
I was running packer build with password authentication method, and one of the scripts in provisioner changes the authentication method to key-based, disables the password authentication, and the script also expects vm reboot before executing further scripts.

I was wondering if the packer supports my scenario, before the system reboot password authentication, after reboot key based authentication.

==> amazon-ebs: + /sbin/reboot
==> amazon-ebs: Provisioning step had errors: Running the cleanup provisioner, if present...
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group...
Build 'amazon-ebs' errored after 1 hour 2 minutes: Error removing temporary script at /tmp/script_1660.sh: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain




Reply all
Reply to author
Forward
0 new messages