<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Schiff Heimlich</title>
    <description>The latest articles on Forem by Schiff Heimlich (@schiff_heimlich).</description>
    <link>https://forem.com/schiff_heimlich</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3949704%2F89c08e96-274f-4f09-a299-8ebdabdc7096.jpg</url>
      <title>Forem: Schiff Heimlich</title>
      <link>https://forem.com/schiff_heimlich</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/schiff_heimlich"/>
    <language>en</language>
    <item>
      <title>SSH Login Delays: The 10-Second Wait That Drives Us Crazy</title>
      <dc:creator>Schiff Heimlich</dc:creator>
      <pubDate>Mon, 25 May 2026 17:07:09 +0000</pubDate>
      <link>https://forem.com/schiff_heimlich/ssh-login-delays-the-10-second-wait-that-drives-us-crazy-16f3</link>
      <guid>https://forem.com/schiff_heimlich/ssh-login-delays-the-10-second-wait-that-drives-us-crazy-16f3</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Every sysadmin has been there: you SSH into a server and wait... and wait... 10 seconds later, you finally get a prompt. It's one of those small annoyances that wears on you over time.&lt;/p&gt;

&lt;p&gt;I ran into this again last week while troubleshooting a production server. The delay wasn't there before, something had changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Causes
&lt;/h2&gt;

&lt;p&gt;After digging into this enough times, I've found these usual suspects:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. DNS Resolution
&lt;/h3&gt;

&lt;p&gt;If your system can't resolve the hostname quickly, SSH will timeout before falling back to the IP. Check your &lt;code&gt;/etc/resolv.conf&lt;/code&gt; and consider adding the server's IP to &lt;code&gt;/etc/hosts&lt;/code&gt; if it's a frequent connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Host Key Verification
&lt;/h3&gt;

&lt;p&gt;First-time connections to new servers (or after key changes) trigger host key verification. This usually happens quickly unless there are DNS issues or the host key verification is timing out.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. PAM Configuration
&lt;/h3&gt;

&lt;p&gt;Sometimes PAM modules are configured with timeouts that cause delays. This is less common but worth checking if the other two don't lead anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Do
&lt;/h2&gt;

&lt;p&gt;My go-to approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Test with IP first&lt;/strong&gt;: &lt;code&gt;ssh user@192.168.1.100&lt;/code&gt; - if this is instant, DNS is the problem&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check DNS&lt;/strong&gt;: &lt;code&gt;nslookup servername&lt;/code&gt; or &lt;code&gt;dig servername&lt;/code&gt; to see if resolution is slow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add to hosts&lt;/strong&gt;: If it's a frequent connection, add the IP to &lt;code&gt;/etc/hosts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check SSH config&lt;/strong&gt;: Look for any custom configurations that might be causing delays&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The fix is usually simple once you identify the root cause. Most of the time, it's just DNS resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Talk
&lt;/h2&gt;

&lt;p&gt;This isn't some complex infrastructure issue - it's one of those small things that makes day-to-day work frustrating. But once you know what to look for, it's a 5-minute fix.&lt;/p&gt;

&lt;p&gt;What about you? Any other causes I've missed? I'm always running into new variations of this.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Schiff Heimlich | Sysadmin who's been bitten by this one too many times&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>dns</category>
      <category>devops</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>SSH Login Taking Forever? Check Your DNS Settings</title>
      <dc:creator>Schiff Heimlich</dc:creator>
      <pubDate>Mon, 25 May 2026 01:05:23 +0000</pubDate>
      <link>https://forem.com/schiff_heimlich/ssh-login-taking-forever-check-your-dns-settings-gej</link>
      <guid>https://forem.com/schiff_heimlich/ssh-login-taking-forever-check-your-dns-settings-gej</guid>
      <description>&lt;h1&gt;
  
  
  SSH Login Taking Forever? Check Your DNS Settings
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;You type &lt;code&gt;ssh user@server&lt;/code&gt;, hit enter, and wait. And wait. Ten seconds later, the password prompt finally appears. It's not network latency — ping is fine. It's not the server — other people connect instantly. It's just your SSH client hanging for no obvious reason.&lt;/p&gt;

&lt;p&gt;This is one of those problems that wastes a small amount of time on a regular basis, which adds up to a large amount of time over months.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Was Done
&lt;/h2&gt;

&lt;p&gt;The culprit is almost always DNS resolution. When SSH tries to connect, it does a reverse DNS lookup on your client IP by default. If your system's DNS resolver is slow, broken, or configured to time out, you get that delay.&lt;/p&gt;

&lt;p&gt;The fix is straightforward: disable DNS lookups in your SSH client.&lt;/p&gt;

&lt;p&gt;Add this to &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;Host&lt;/span&gt; *
    &lt;span class="k"&gt;UseDNS&lt;/span&gt; &lt;span class="no"&gt;no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Restart your SSH connection and the delay disappears.&lt;/p&gt;

&lt;p&gt;If you're curious why this happens: SSH calls &lt;code&gt;getaddrinfo()&lt;/code&gt; which goes through your resolver. On systems with systemd-resolved, the stub resolver sometimes has issues with certain query types. On VPS environments, DNS can route through slow upstream resolvers. The lookup eventually times out or succeeds, but you've already lost those seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Before you blame the network, the server, or your ISP — check if SSH is doing DNS lookups. The &lt;code&gt;UseDNS no&lt;/code&gt; option is a one-line fix that pays off every single time you connect.&lt;/p&gt;

&lt;p&gt;If you're managing servers and want to help your users, make sure reverse DNS works correctly for your IP ranges. That way, users who keep &lt;code&gt;UseDNS&lt;/code&gt; on (the default) won't suffer either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;It's a small quality-of-life fix. But small fixes that you use dozens of times a day add up.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>linux</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
