Share via

Can't connect to Red Hat Linux VM via Putty and SSH

Tom Smith 70 Reputation points
2025-09-19T13:55:20.56+00:00

When trying to connect to Linux VM via Putty and SSH (port 22), I can't connect and get a time out message. I can connect via the Azure CLI and to the console in Azure.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

Answer accepted by question author

  1. Jilakara Hemalatha 12,915 Reputation points Microsoft External Staff Moderator
    2025-09-19T14:14:18.4633333+00:00

    Hi Tom Smith,

    As the information provided was limited, I would like to clarify the issue based on my current understanding:

    1. Inbound Port Rules: Please verify that the Network Security Group (NSG) associated with the virtual machine has an inbound rule allowing SSH traffic on port 22.
    2. SSH Authentication: If you are using SSH key-based authentication, ensure that you have generated the private key using PuTTYgen. This private key must be used with an SSH client (e.g., PuTTY) to successfully establish the connection to the VM.

    Reference: https://learn.microsoft.com/en-us/azure/virtual-machines/linux-vm-connect?tabs=Linux

    Adding Root cause of the issue here:

    The root cause of the SSH timeout was related to custom networking configuration during VM creation. The VM was initially deployed with manual changes to the IP settings and virtual network configuration, which caused the network interface and security rules not to be correctly applied. As a result, SSH traffic on port 22 could not reach the VM even though the NSG appeared to allow it.

    To resolve the issue recommended

    Recreated the virtual machine in the same region (East US) but with the Networking tab left at its default settings in new RG.

    Ensured the public IP address, NSG, and subnet were automatically configured by Azure.

    After these changes, the VM became reachable and the SSH connection via PuTTY and SSH succeeded without timeouts.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.