An Azure service that is used to provision Windows and Linux virtual machines.
How to fix connection refused for ssh connection on port 22 for virtual machine via Ribbon SBC
When I try to ssh via bash, I keep getting this connection refused error, does anyone have any potential ideas/fixes?
Azure Virtual Machines
-
Nikhil Duserla • 9,950 Reputation points • Microsoft External Staff • Moderator
2025-11-13T07:48:31.7733333+00:00 Hello Thai,
I understand your issue. If you are attempting to connect to the VM using a password, please ensure that a password was set during the VM creation process. If not, you will need to reset it. In the VM settings, on the left-hand menu, you’ll find several options — select “Reset password” to create or update your credentials.
If you are connecting using an SSH key, please specify the path as shown in the command below:-
ssh -i <private key path> username@ipaddressPlease refer to this link for more in detailed troubleshooting steps- https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/troubleshoot-ssh-connection
If you have any further queries, do let us know.
-
Thai • 5 Reputation points
2025-11-13T21:57:45.5033333+00:00 Hi! I tried resetting the password and adding an SSH key, but both methods still give me the same error, "Connection Refused." Got any more ideas on what it could be? Also, here's my inbound port rules as well, maybe it has something to do with this?
-
-
Nikhil Duserla • 9,950 Reputation points • Microsoft External Staff • Moderator
2025-11-14T13:36:34.8766667+00:00 Hello Thai,
Thank you for the response. Please delete the existing rule for port 22 and create a new rule allowing port 22, assigning it a high priority (e.g., 300). After updating the rule, try connecting again.
If you have any further queries, do let us know.
-
Thai • 5 Reputation points
2025-11-14T22:16:43.8733333+00:00 Hi! Just tried this and it's still giving the connection refused error, got any more potential fixes?
-
Thai • 5 Reputation points
2025-11-14T23:07:35.77+00:00 Also, I'm trying to SSH because when the VM deployed, I already have andersonsbc.westus2.cloudapp.azure.com up and running, but I want to have; https://andersonsbc.westus2.cloudapp.azure.com/.well-known/pki-validation/A4C65A4A6430730325C1F1DCC44DCE12.txt have validation contents for SSL certificate validation via the HTTP method, so i need to create that .well-known/pki-validation/A4C65A4A6430730325C1F1DCC44DCE12.txt pathing via SSH into the VM and add the pathing. However, there are other ways to validate the SSL certificate such as DNS validation, but the main way I'm trying now is the HTTP method, hence why I need to SSH into the VM. However, if there's another way to add the .well-known/pki-validation/A4C65A4A6430730325C1F1DCC44DCE12.txt such as via the serial console in the VM, I would greatly appreciate any recommendation.
-
Nikhil Duserla • 9,950 Reputation points • Microsoft External Staff • Moderator
2025-11-17T07:47:59.1233333+00:00 Hello Thai,
To understand this issue in more detail, please share your available time and email ID in a private message. I will arrange a call with you and help resolve the issue.
Thank you!
-
Thai • 5 Reputation points
2025-11-18T23:55:46.64+00:00 Hi Nikhil! I found a potential fix that I'm going to be implementing over the next couple of days which is buying a domain, having the domain point to my VM public IP, then using DNS verification for my SSL certificates. Will let you know how that goes.
-
Nikhil Duserla • 9,950 Reputation points • Microsoft External Staff • Moderator
2025-11-19T09:25:47.63+00:00 Hi Thai, thank you for sharing the information. Let me know if you required my help.
Sign in to comment