When a new VM is created on Azure, by-default the Protocol TCP on Port 22 is Disabled. This will not let you SSH into the VM either from Azure’s Cloud Shell or external access from a Mac Terminal or Putty.
You may see this:
To use SSH on Cloud Shell or Mac Terminal or Putty, do the following:
- Select the VM
- Select “Networking”
- On the right, select “Add inbound port rule”. This should open a popup
- Source: Any (default)
- Source port range: * (default)
- Destination: Any (default)
- Destination port ranges: 22
- Protocol: TCP
- Action: Allow
- Priority: 330 (default)
- Name: Enable 22 (can be anything you can identify)
- Select “Add“
Now try to SSH, and you should be able to.