当我看~/。ssh/authorized_keys作为root用户在我的ami上,我看到如下内容:
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
第二个键是我用来设置实例的键,所以我理解那个键。封包密钥只是一个临时密钥,用于将实例上传到某个地方,我可以安全地删除它?
Packer用于创建AMI,在此过程中它需要ssh到映像中。通常,创建AMI的人会在最终化和清理过程中删除它们,似乎他们忘记了这样做。删除它们是安全的。