2 Answers
- Newest
- Most votes
- Most comments
2
Hello.
The document below states that it will no longer work.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances--turn-off-instance-metadata
You can choose to disable the IMDS at launch or after launch. If you disable the IMDS at launch, the following might not work:
- You might not have SSH access to your instance. The public-keys/0/openssh-key, which is your instance's public SSH key, will not be accessible because the key is normally provided and accessed from EC2 instance metadata.
- EC2 user data will not be available and will not run at instance start. EC2 user data is hosted on the IMDS. If you disable the IMDS, you effectively turn off access to user data.
To access this functionality, you can re-enable the IMDS after launch.
0
To access this functionality, you can re-enable the IMDS after launch.
I did this one as well though. Started with IMDS disabled at launch then re-enabled it before I attempted my first SSH. Or does it need a reboot after re-enabling IMDS perhaps?
Edit: Confirmed SSH access after rebooting post re-enabling IMDS.
answered 23 days ago
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
cloud-init is running when an EC2 instance is launched. cloud-init is fetching the SSH public key from the instance metadata and updating ~/.ssh/authorized_keys. In other words, if you configure cloud-init to run after rebooting, the key pair will be set. https://repost.aws/knowledge-center/execute-user-data-ec2
I actually tried it in my environment, and I was able to confirm that I could SSH by rebooting.