Share via

Unable to SSH to Azure VM on Port 22 in UAE North Region

Sushant Sharma 0 Reputation points
2026-03-11T19:09:36.9166667+00:00

Environment:

  • Azure Region: UAE North
  • VM OS: Ubuntu
  • Connection Method: SSH (Port 22)

Issue: I am unable to establish SSH connection to my Azure Ubuntu VM in the UAE North region on port 22. The connection either times out or is refused.

Inbound rule exists allowing TCP port 22

VM is running and shows as healthy in Azure Portal

VM Resource Health shows no issues

Azure Virtual Machines
Azure Virtual Machines

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

{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 82,355 Reputation points MVP Volunteer Moderator
    2026-03-11T19:11:46.2266667+00:00

    Follow https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/troubleshoot-ssh-connection

    Quick troubleshooting steps

    After each troubleshooting step, try reconnecting to the VM.

    Reset the SSH configuration.

    Reset the credentials for the user.

    Verify the network security group rules permit SSH traffic and role assignment.

    Ensure that a Network Security Group rule exists to permit SSH traffic (by default, TCP port 22).

    You cannot use port redirection / mapping without using an Azure load balancer.

    If you are using Microsoft Entra ID to manage SSH logins, the user must be assigned the Virtual Machine Administrator Login or Virtual Machine User Login role on the resource group that contains the VM and its associated resources. Otherwise, the "Permission denied (publickey)" error will be received. For more information, see Configure role assignments for the VM that uses Microsoft Entra login.

    Check the VM resource health.

    Ensure that the VM reports as being healthy.

    If you have boot diagnostics enabled, verify the VM is not reporting boot errors in the logs.

    Restart the VM.

    Redeploy the VM.

    Continue reading for more detailed troubleshooting steps and explanations.

    Available methods to troubleshoot SSH connection issues

    You can reset credentials, SSH configuration, or troubleshoot the status of the SSH service by using one of the following methods:

    Azure portal - great if you need to quickly reset the SSH configuration or SSH key and you don't have the Azure tools installed.

    Azure VM Serial Console - the VM serial console will work regardless of the SSH configuration, and will provide you with an interactive console to your VM. In fact, "can't SSH" situations are specifically what the serial console was designed to help solve. More details below.

    Use Run Command through Azure portal - You can run basic commands by using the Run Command functionality through the Azure portal. The output will be returned to the portal.

    Azure CLI - if you are already on the command line, quickly reset the SSH configuration or credentials.

    Azure VMAccessForLinux extension - create and reuse json definition files to reset the SSH configuration or user credentials.

    After each troubleshooting step, try connecting to your VM again. If you still cannot connect, try the next step.

    If you are still unable to SSH to your VM after following the after steps, see more detailed troubleshooting steps to review additional steps to resolve your issue.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

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.