1 Answers
Hi.
While you are logged in you can remove the public keys that are there.
Have you seen this guide? It provides some helpful instructions on how to clean up a machine before creating the AMI.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html
When you launch a new instance using the AMI, AWS will append the ec2 key pair public key you selected to the list of authorised keys on the new instance.
Chatz