📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

SSH takes several seconds before authentication prompt, especially from some source networks.

Environment & Reproduction

sshd performs reverse DNS lookup and waits for slow or failing resolver responses.

Root Cause Analysis

Run: sudo sshd -T | grep usedns and inspect login timing with ssh -vvv.

Quick Triage

Check DNS resolution speed for client IP and confirm local resolver health.

Step-by-Step Diagnosis

Capture debug trace showing delay before auth starts.

Illustrative mockup for rhel-9 — rhel9-ssh-slow-login-01.webp
SSH session hangs before password prompt appears — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Capture sshd_config directive update and service reload.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for rhel-9 — rhel9-sshd-config-usedns-no-02.webp
Setting UseDNS no in sshd_config for faster authentication — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Edit /etc/ssh/sshd_config and set: UseDNS no.

Verification & Acceptance Criteria

Validate syntax: sudo sshd -t.

Rollback Plan

Reload service: sudo systemctl reload sshd.

Prevention & Hardening

Reconnect and compare login time; delay should be eliminated or substantially reduced.

Keep DNS infrastructure healthy and enforce tested sshd baseline through automation.

Related tutorial: View the step-by-step tutorial for rhel-9.

View all rhel-9 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Revert UseDNS setting and reload sshd if policy requires reverse lookup.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.