Can't Connect to VM using SSH

Ramin Payandeh 1 Reputation point
2022-11-07T14:24:06.87+00:00

Hi

I have a Linux VM on my Azure portal using student subscription.
I Can't stablish SSH connection to my VM "Operation timed out" using Mac Terminal.
Seems like this happens because of not having any NSG applied to the server.
Also there are no options for adding NSG rule for ssh port 22 (as seen in the screen shot).
What shoud I do?

Thanks in advance257923-screenshot-2022-11-07-at-54729-pm.png

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,101 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 96,036 Reputation points MVP
    2022-11-07T15:53:43.75+00:00

    Hi @Ramin Payandeh ,

    what kind of Public IP SKU is associated with the NIC of the VM?

    If it is a Basic Public IP there is no requirement of an NSG. The IP and all ports should be reachable by default.
    If it is a Standard Public IP all ports are blocked by default. You have to create and assiciate a Network Security Group (NSG) to the NIC and create a Inbound Security Rule that allows SSH (Port 22) -> https://learn.microsoft.com/en-us/azure/virtual-network/tutorial-filter-network-traffic#create-a-network-security-group

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments