1 Answer
- Newest
- Most votes
- Most comments
0
If you mean a Key for SSH access, there is no native way to replace the old key with a new key for an early-created EC2 instance. What you can do:
- Connect to EC2 via SSH or Sessions Manager and modify file
.ssh/authorized_keys
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replacing-key-pair.html
- As an alternative to key pairs, you can use AWS Systems Manager Session Manager to connect to your instance with an interactive one-click browser-based shell or the AWS Command Line Interface (AWS CLI).
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago

please accept the answer if it was useful