What happened
Following a successful packer build, SSH keys are left in the ssh agent.
Most SSH daemons will reject authentication after 3 attempted failures, so successive runs of the packer tool can cause unexpected authentication failures both in successive packer runs and for the SSH client in general.
The user can work around this by issuing a ssh-add -D command to clear all identities from the SSH agent.
Expected
Packer (or one of it's provisioners or builders) should not load keys into the SSH agent, or if it does - should remove them when it's done.
Notes
This might be environmental on my machine, I haven't had a chance to replicate on a spare user profile yet. Likewise, I'll update with a minimal config and debug shortly.
Environment Packer 1.1.3 macOS 10.13.2 (17C205)
Build Details Builder:
amazon-ebs
Provisioners:ansible
What happened Following a successful
packer build
, SSH keys are left in the ssh agent.Most SSH daemons will reject authentication after 3 attempted failures, so successive runs of the packer tool can cause unexpected authentication failures both in successive packer runs and for the SSH client in general.
The user can work around this by issuing a
ssh-add -D
command to clear all identities from the SSH agent.Expected Packer (or one of it's provisioners or builders) should not load keys into the SSH agent, or if it does - should remove them when it's done.
Notes This might be environmental on my machine, I haven't had a chance to replicate on a spare user profile yet. Likewise, I'll update with a minimal config and debug shortly.