Troubleshooting SSH Remote Machine Delayed Connection (2 minutes) on Windows 11 and RHEL 9

Abstract: Resolve the two-minute SSH connection delay on RHEL 9 by disabling UseDNS in sshd_config to prevent hanging reverse DNS lookups.

Created: 2026-10-23 by
A two-minute delay during SSH connections from Windows 11 to RHEL 9 is typically caused by the server attempting reverse DNS lookups on the client's IP address or failing to resolve the client's hostname. This process hangs until a timeout occurs, which standardly lasts around 120 seconds. You can resolve this immediately by disabling UseDNS in the SSH daemon configuration or by ensuring your network has proper PTR records.

Understanding the Root Cause

When an SSH client initiates a connection, the server performs several security checks before accepting the login. One of the most common sources of significant latency is the reverse DNS lookup. The SSH daemon (sshd) on the RHEL 9 server attempts to resolve the IP address of the connecting Windows 11 machine back into a hostname. If the DNS server does not have a Pointer (PTR) record for that IP, or if the DNS query times out due to network issues, the server waits for the default timeout period before proceeding. This behavior is governed by the UseDNS directive in the SSH server configuration. By default, many Linux distributions enable this feature to enhance security by verifying that the client's IP matches its hostname. However, in environments where dynamic IP addresses are common or where DNS infrastructure is slow or misconfigured, this check becomes a bottleneck. The two-minute delay is not arbitrary; it aligns closely with the default timeout values for DNS queries in many system configurations. Another potential cause involves the GSSAPI authentication mechanism, which may attempt to negotiate Kerberos tickets even when not explicitly requested, leading to similar timeouts if no Kerberos domain is available.

Disabling Reverse DNS Lookups

The most effective and immediate solution for most users is to disable the reverse DNS lookup on the RHEL 9 server. This change requires modifying the SSH daemon configuration file. You will need root access to edit the file located at /etc/ssh/sshd_config. Open this file using your preferred text editor, such as vim or nano, and search for the line containing UseDNS. If the line is commented out with a hash symbol (#), uncomment it. If it already exists, modify its value. Set the directive to no as shown below:
UseDNS no
After saving the changes, you must restart the SSH service for the new configuration to take effect. On RHEL 9, use the following command:
sudo systemctl restart sshd
This action tells the server to skip the reverse DNS verification step entirely. While this slightly reduces the security overhead associated with hostname verification, it eliminates the network dependency that causes the delay. For most internal networks and development environments, this trade-off is negligible and highly beneficial for user experience. If you are concerned about security, ensure that other controls, such as firewall rules and key-based authentication, are properly configured.

Addressing GSSAPI Authentication Timeouts

Another common culprit for delayed connections is GSSAPI authentication. Even if you do not intend to use Kerberos, the SSH client may attempt to initiate a GSSAPI exchange. If the client cannot contact a Key Distribution Center (KDC), the process hangs. You can mitigate this by disabling GSSAPI authentication on either the client or the server side. On the Windows 11 client, you can often control this behavior via the SSH configuration file if you are using OpenSSH for Windows. Edit or create the file at C:\Users\YourUsername\.ssh\config and add the following lines for your specific host or globally:
Host *
    GSSAPIAuthentication no
Alternatively, you can disable it on the RHEL 9 server by adding GSSAPIAuthentication no to /etc/ssh/sshd_config and restarting the service. This prevents the server from negotiating GSSAPI credentials, forcing it to rely on standard password or public-key methods, which are much faster. It is important to note that disabling these features should only be done if you are certain they are not required for your specific security policies.

Verifying Network and DNS Configuration

While software configuration changes provide quick fixes, ensuring robust network infrastructure is the long-term solution. If you prefer to keep UseDNS enabled for security reasons, you must ensure that your DNS servers have valid PTR records for all client machines. This involves configuring your DHCP server or static IP assignments to include corresponding reverse DNS entries. You can test DNS resolution manually from the RHEL 9 server using the nslookup or dig commands against the Windows 11 client's IP address. If these commands hang or return errors, the issue lies within your DNS infrastructure rather than the SSH configuration. Additionally, check for any firewall rules that might be blocking UDP port 53, which is used for DNS queries. Intermittent packet loss on this port can also cause delays, though less severe than full timeouts. For more details on managing SSH keys and agents, you might find List of ssh keys provided by ssh agent on a remote machine helpful, as proper key management can further streamline the authentication process. Similarly, understanding how to troubleshoot name resolution failures is crucial, as outlined in SSH: Temporary Name Resolution Failure for 'desktop11900'.

Frequently Asked Questions

Does disabling UseDNS compromise SSH security?

It slightly reduces one layer of defense against spoofing attacks, but it does not affect encryption or authentication strength. In most private networks, the risk is minimal compared to the usability gain.

Why does the delay happen even with key-based authentication?

The reverse DNS lookup occurs during the connection setup phase, before authentication begins. Therefore, whether you use passwords or keys, the server still performs the DNS check first.

Can I fix this on the Windows 11 side only?

You can disable GSSAPI on the client, which helps if GSSAPI is the cause. However, if the delay is due to reverse DNS, the fix must be applied on the RHEL 9 server.

What if I don't have root access on the RHEL 9 server?

If you cannot modify sshd_config, you may need to contact your system administrator. Alternatively, you can try using the -o GSSAPIAuthentication=no flag in your SSH command to rule out GSSAPI issues.

How can I verify if UseDNS is causing the delay?

Run ssh -v user@host on the Windows 11 machine. Look for lines indicating "Trying reverse name lookup" or delays between connection establishment and authentication prompts.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More