Hi ,
Please run the below command for this VM inorder to allow port 22 for inbound connectivity use serial console to do this
ufw allow 22/tcp
It is also possible to open port by service name instead of the port number
ufw allow ssh
After that, you can check connecting to VM through public IP address via SSH using a putty or bash. If you continue to see the same issue, then check security rules
Use IP flow verify to confirm if a rule in a network security group is blocking traffic to or from a virtual machine. You can also review effective security group rules to ensure inbound "Allow" NSG rule exists and is prioritized for SSH port (default 22). For more information, see Using effective security rules to troubleshoot VM traffic flow.
Or you can else Use the Azure VM Serial Console to further troubleshoot your SSH connectivity.
For detailed troubleshooting, you can refer to troubleshoot-ssh-connection
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
How to fix SSH connection issue with Ubuntu VM
Martin S
0
Reputation points
Hi, Our VM instance has been stopped for a few months but we have recently restarted it but we are unable to connect using SSH.
We ran the issue through the troubleshooter with the below result:
How would we go about fixing this issue? Thanks!
1 answer
Sort by: Most helpful
-
Deepanshu katara 14,895 Reputation points MVP
2024-01-30T11:10:25.3666667+00:00