I am using Packer to build AMIs for EC2 instances.
I am trying to use “ssh_clear_authorized_keys” in my packer build to ensure that the keys do not show up in the EC2 instances built out of my AMI.
My final AMI is built using a series of Packer builds chained together
AMI A is the base image, AMI B uses AMI A, and finally AMI C uses AMI B to get the final image.
I am setting “ssh_clear_authorized_keys” to true in the packer.json for AMI C.
When I issue a “cat authorized_keys” command, I see one key still showing up.
Note: without the “ssh_clear_authorized_keys”, I get 3 keys.
Can someone help me understand where this key is leftover from?
In general, I would like to better understand the workings of this field.