When I look into ~/.ssh/authorized_keys
on my AMI I see something like:
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ubuntu\" rather than the user \"root\".';echo;sleep 10;exit 142" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5Cfdsafdafdas_some_public_key packer_610ad8fb-0ed3-eddc-c48f-0f8553d421da
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ubuntu\" rather than the user \"root\".';echo;sleep 10;exit 142" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5Cfdsafdafdas_some_public_key my-key
The second key is the one I used to set up my instance so I understand that one. Is Packer's key just a temporary key used to upload the instance somewhere and can I safely delete it?
Packer is used to create AMI and during that process it needs to ssh into the image. Normally, people who create the AMI remove them during the finalization and cleanup, seems they forgot to do that. It's safe to delete them.