Reputation: 10163
I'm trying to login into google compute engine VM instance.
$ gcloud compute ssh gke-kubia-default-pool-5af12345-abcd --zone=us-east1-b
It took very long time and then gave resulted in the below error.
ssh: connect to host b.b.c.d port 22: Operation timed out
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
I tried to login in my mac terminal as well as browser terminal in web interface. Any idea, how to resolve this error.
Upvotes: 3
Views: 6185
Reputation: 564
Check if you have a firewall rule that permits ingress connections on port 22. The default rule looks like this default-allow-ssh Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:22 Allow 1000 default
If you don't see it under
You can create it by running: $ gcloud compute firewall-rules create mySSH --allow tcp:22 --source-ranges 0.0.0.0/0
I would also try to test the connection by running:
$ telnet IP 22
EDIT => additional info:
For some tips on SSH troubleshooting you can have a look at this guide.
There is this StackOverflow thread that might be helpful as well.
Upvotes: 2