cannot ssh into vm after changing the default port no for ssh?

Anish S 1 Reputation point
2021-03-20T20:38:52.67+00:00

Hey,
I changed the default ssh port from 22 to a different one and then restarted the ssh service on the vm , and then in order to check the changes are working or not I tried to ssh to the vm on a different powershell window on my machine without logging out of the connected one but I cannot ssh to the vm using the new port no I am getting Connection timed out error . But if I change the port no to default that is 22 I can ssh into the vm can anyone help me with this?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,567 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 12,391 Reputation points Microsoft MVP
    2021-03-20T23:49:10.99+00:00

    Hi @Anish S
    Thank You for posting in Q & A.

    After changing the default ssh port on the VM, can you verify that new ssh port is added in the NSG rules. once new ssh port is added in the NSG rules or FW you can able to connect on the VM

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    No comments