Connection Refused PuTTY to VMWare Workstation Guest Rocky Linux

Abstract: Resolve PuTTY connection refused errors to Rocky Linux VMs by configuring Bridged networking or NAT port forwarding in VMware Workstation.

Created: 2026-08-08 by

The "Connection Refused" error in PuTTY when targeting a VMware Workstation guest running Rocky Linux typically indicates that the SSH daemon is not listening on the expected network interface or port. This is most commonly caused by the virtual machine's network adapter being set to NAT mode with an isolated subnet, while the host machine attempts to connect via localhost without proper port forwarding configured.

Verifying Network Adapter Configuration

The first step in troubleshooting this connectivity issue is to examine how the virtual machine is connected to the physical network. In VMware Workstation, the default configuration for new virtual machines is often "NAT" mode. While NAT allows the guest OS to access the internet through the host, it does not automatically expose the guest's services to the host unless specific rules are applied. If your VM is set to NAT, you cannot simply connect to the host's IP address (127.0.0.1) and expect traffic to route directly into the guest's SSH service on port 22 without additional configuration. To check your current setting, open VMware Workstation and navigate to the virtual machine settings. Select the Network Adapter option. You will see three choices: Bridged, NAT, and Custom. If you wish to avoid complex port forwarding rules, switching this to Bridged mode is the most straightforward solution. Bridged mode makes the VM appear as a distinct device on your local LAN, assigning it its own IP address from your router's DHCP pool. Once switched to Bridged, ensure that the "Connect at power on" box is checked. After applying these changes, restart the virtual machine. The guest Rocky Linux instance should now acquire a unique IP address visible from the host machine, which can be found using the ip addr show command within the terminal.

Configuring Port Forwarding in NAT Mode

If you must keep the network adapter in NAT mode, perhaps due to corporate firewall restrictions or specific lab requirements, you need to manually configure port forwarding. This process tells VMware Workstation to listen on a specific port on the host and redirect incoming traffic to the guest's internal IP. Access the Edit menu in VMware Workstation and select Virtual Network Editor. You may need administrative privileges to modify these settings. Locate the VMnet8 entry, which corresponds to the NAT network, and click on NAT Settings. In the Port Forwarding section, click Add. You will need to define a Host Port and a Guest Port. Typically, you map Host Port 2222 to Guest Port 22. This means you will connect to PuTTY using the host's IP address on port 2222 instead of the standard SSH port. Ensure that the IP address listed for the guest matches the one assigned by VMware's internal DHCP server. Save the settings and restart the VMware services if necessary. This method isolates the SSH traffic but requires careful management of port numbers to avoid conflicts with other services running on the host. For users managing cloud instances rather than local VMs, similar connectivity issues arise when trying to reach EC2 instances. See our guide on Unable to Connect Linux EC2 Instance via Putty (OpenSSH) on Windows Machine for broader context on SSH connection refusals across different environments.

Checking the OpenSSH Service Status

Even with correct network configurations, the SSH server itself might not be running or might be bound to a different interface. Rocky Linux uses systemd to manage services. Open a terminal inside the Rocky Linux guest and run sudo systemctl status sshd. If the service is inactive or failed, start it using sudo systemctl enable --now sshd. This command ensures the service starts automatically upon boot and begins immediately. You should also verify that the service is listening on the correct interface. Use the command ss -tlnp | grep :22 to list active TCP listeners on port 22. Look for lines indicating :22 associated with either 0.0.0.0 or ::. If you see only 127.0.0.1:22, the SSH daemon is restricted to local connections only, rejecting external attempts from the host or network. To fix this, edit the /etc/ssh/sshd_config file. Find the line starting with #ListenAddress and uncomment it, ensuring it is set to 0.0.0.0 or removed entirely to allow all interfaces. Restart the SSH service after making any changes to the configuration file.

Inspecting Firewall Rules

Rocky Linux employs firewalld as its default dynamic firewall manager. Even if SSH is running and listening, the firewall may block incoming connections on port 22. Check the current status by running sudo firewall-cmd --list-all. Look for the ports or services sections in the output. If ssh is not listed under services, or if port 22 is not explicitly allowed, you must add it. Enable the SSH service permanently by executing sudo firewall-cmd --permanent --add-service=ssh. Follow this by reloading the firewall configuration with sudo firewall-cmd --reload. This ensures that the rule persists across reboots. If you are using a custom port due to port forwarding, you must add the specific port instead, such as sudo firewall-cmd --permanent --add-port=2222/tcp. Verify the change again with --list-all to confirm the port or service is now permitted. Another common pitfall involves SELinux contexts, though less likely to cause a hard refusal compared to firewalls. Ensure that SELinux is not enforcing strict policies that block SSH. You can check the status with getenforce. If it returns Enforcing, verify that the SSH ports are correctly labeled using semanage port -l | grep ssh. Usually, the default setup handles this correctly, but misconfigurations can occur. For those encountering gateway issues that complicate network routing in virtual environments, refer to Troubleshooting Weird Gateway Issue in VMware to ensure your virtual network infrastructure is stable.

Testing Connectivity and Final Verification

Once the network mode, SSH service, and firewall are aligned, test the connection from the host machine. Open PuTTY and enter the IP address of the host (for NAT with port forwarding) or the guest (for Bridged). Set the port number accordingly. If you changed the SSH port in sshd_config, update the PuTTY port field to match. Click Open. If the connection still fails, use the telnet command or nc -zv from the host command line to test raw TCP connectivity before invoking PuTTY. For example, nc -zv 192.168.x.x 22 will tell you if the port is reachable at the packet level. If tel succeeds but PuTTY fails, the issue lies within PuTTY's key exchange algorithms or encryption settings, requiring you to adjust the connection type to SSH-2 and potentially disable older cipher suites in the PuTTY configuration window.

Frequently Asked Questions

Why does my VM have no IP address in Bridged mode?

This usually happens because the physical network does not provide DHCP addresses, or the virtual switch is disconnected. Ensure your physical Ethernet or Wi-Fi adapter is active and that the VMware Virtual Network Editor has the correct bridged adapter selected. Restarting the network service inside the guest with sudo systemctl restart NetworkManager often resolves stale lease issues.

Can I use SSH keys instead of passwords for PuTTY?

Yes, generating an SSH key pair on your host and adding the public key to ~/.ssh/authorized_keys on the Rocky Linux guest is more secure than password authentication. You must ensure PubkeyAuthentication yes is set in /etc/ssh/sshd_config and restart the SSH service. PuTTY then uses Pageant or direct key loading to authenticate seamlessly.

What causes 'Host Key Verification Failed' after fixing Connection Refused?

This error occurs when the SSH host key changes, often because the VM was cloned or the disk image restored from a backup. Delete the old host key entries from your known_hosts file on the host machine, or accept the new key prompt in PuTTY. This confirms you are connecting to the updated virtual machine identity.

Is it safe to disable firewalld completely?

Disabling the firewall is generally unsafe as it exposes all services to potential attacks. Instead, selectively allow only the necessary ports like SSH (22) and any other required services. Using firewall-cmd --add-service=ssh maintains security while enabling the specific connectivity you need for remote administration.

How do I find the guest IP if I am unsure of the network setup?

Log into the VMware Workstation console directly and run hostname -I or ip addr show inside the Rocky Linux terminal. This displays all assigned IP addresses regardless of whether the network is NAT, Bridged, or Host-only. Use the IPv4 address corresponding to the active interface for your PuTTY connection.

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