Logo Volodymyr's Blog
  • Home
  • About
  • Skills
  • Experiences
  • Featured Posts
  • More
    Recent Posts Accomplishments
  • Posts
  • Notes
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • GitHub
    • GitHub Actions Basics
  • Kafka
    • Kafka Basics
  • Tools
    • fio Benchmarking
    • Git Worktree
  • Networking
    • HTTP/3 and QUIC
    • Mutual TLS
  • AWS
    • Locked Out of EC2
Hero Image
Locked Out of EC2: Restoring SSH Access With User Data

$ ssh admin@203.0.113.25 admin@203.0.113.25: Permission denied (publickey). The instance is healthy. The security group is right. The disk is fine. You simply no longer hold the key that gets you in — the laptop was reimaged, the key was never committed anywhere, or it belonged to someone who left. AWS cannot help you here, and that is by design. The fix is to make the instance add a key you do hold, on its next boot, using the one channel you still control: user data.

  • AWS
  • EC2
  • SSH
  • cloud-init
  • Recovery
Tuesday, April 14, 2026 | 10 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Featured Posts
  • Recent Posts
  • Accomplishments
Contact me:
  • vzavalskyi
  • Volodymyr Zavalskyi

Liability Notice: This website provides information for personal and educational purposes only. While I strive for accuracy, the information is provided ‘as is’ without any guarantees of completeness or usefulness. Any reliance you place on such information is strictly at your own risk. This website may contain links to external sites. I am not responsible for the content of those sites and do not endorse them. Users are responsible for any decisions made based on the information found on this website. For details on how I handle personal information, please refer to my Privacy Policy. I reserve the right to modify or update content on this website at any time without prior notice.


Toha Theme Logo Toha
2025 © Volodymyr Zavalskyi. All rights Reserved.
Powered by Hugo Logo