<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>EC2 on Volodymyr's Blog</title><link>https://vzav.eu/tags/ec2/</link><description>Recent content in EC2 on Volodymyr's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 14 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://vzav.eu/tags/ec2/index.xml" rel="self" type="application/rss+xml"/><item><title>Locked Out of EC2: Restoring SSH Access With User Data</title><link>https://vzav.eu/posts/aws/ec2-lost-key/</link><pubDate>Tue, 14 Apr 2026 00:00:00 +0000</pubDate><guid>https://vzav.eu/posts/aws/ec2-lost-key/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ssh admin@203.0.113.25
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;admin@203.0.113.25: Permission denied (publickey).
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;AWS cannot help you here, and that is by design. The fix is to make the instance add a key you &lt;em&gt;do&lt;/em&gt; hold, on its next boot, using the one channel you still control: &lt;strong&gt;user data&lt;/strong&gt;.&lt;/p&gt;</description></item></channel></rss>