π ~1 min read
Table of contents
Symptom & Impact
SSH authentication succeeds but initial login takes 10-30 seconds. Automation jobs time out, and administrators perceive random server slowness on Ubuntu 22.04.
Environment & Reproduction
Ubuntu 22.04 LTS using OpenSSH server in networks with incomplete PTR records. Reproduce by connecting from IP addresses lacking reverse DNS entries.
Root Cause Analysis
sshd may perform hostname lookups that stall when DNS PTR queries timeout. Combined with GSSAPI and PAM network calls, this significantly delays session establishment.
Quick Triage
Measure connection timing with verbose SSH output and confirm DNS latency for client IP reverse lookup path.
Step-by-Step Diagnosis
Review sshd logs and configuration for UseDNS, GSSAPIAuthentication, and PAM modules that depend on network identity services.

Solution – Primary Fix
Disable reverse DNS lookups for SSH, optionally disable unused GSSAPI auth, then reload sshd and retest login latency from affected source networks.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Fix upstream DNS PTR records, deploy local DNS cache, or tune resolver timeout values where reverse lookups are required for audit or policy reasons.
Verification & Acceptance Criteria
SSH interactive login starts within expected threshold, automation scripts stop timing out, and sshd logs show no prolonged pre-auth delays.
Rollback Plan
Re-enable previous sshd settings from backup, reload service, and restore DNS troubleshooting path if disabling UseDNS conflicts with audit requirements.
Prevention & Hardening
Maintain accurate DNS records, validate SSH latency in monitoring, and keep sshd_config standardized across Ubuntu 22.04 estates.
Related Errors & Cross-Refs
Related to PAM LDAP delays, SSSD cache misses, and slow banner generation from shell initialization scripts on remote login.
Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.
View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Consult sshd_config(5), Ubuntu OpenSSH server guide, and resolver troubleshooting documentation for reverse DNS behavior.
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.