Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my VM instance stuck when I try to do SSH?

When I build a VM default settings with Ubuntu 16 and CentOS 7 (those are the ones I've tried) I keep getting stuck when I try to do SSH. The message is:

Establishing connection to SSH server...

And then it times out with:

You cannot connect to the VM instance because of an unexpected error.
Wait a few moments and then try again. (#79)

I enabled OS login hoping the behavior will change but it just stays stuck.

Everything is default except that I enabled "HTTP and HTTPS" access when creating the VM. (I tried building it without these options checked and I get to the same problem.

like image 571
Cesar V. Avatar asked Dec 13 '25 04:12

Cesar V.


2 Answers

Can you make sure that you have port 22 allowed from your network to the VM? You can create a rule by going to VPC --> Firewall Rules --> Create New Rule.

This page has detailed steps.

Hope this helps.

like image 194
pradeep Avatar answered Dec 16 '25 05:12

pradeep


As manesioz commented, follow this guide to discard the common issues, as you said that this happens immediately after creation, most likely you're missing some firewall rules. Also consider to do a nmap scan to see if the port 22 is open in your instance. Do the next in cloud shell:

sudo apt-get install -y nmap

nmap -Pn YOUR_EXTERNAL_IP

Look for port 22 open

like image 28
AdolfoOG Avatar answered Dec 16 '25 05:12

AdolfoOG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!