user51
user51

Reputation: 10163

google compute engine ssh is very slow and then timed out

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

Answers (1)

Pauloba
Pauloba

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

  • VPC Network
  • Firewall rules

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:

Upvotes: 2

Related Questions