Reputation: 818
I am using the following command to access my instance on Google Compute Engine:
gcutil ssh my-instance-name
but it gives me this error:
ssh: connect to host ip-address port 22: Connection refused
I checked and deactivated the firewall, but I am still getting this error. Can someone please tell me how to solve this?
Upvotes: 2
Views: 3522
Reputation: 17
Google Compute Engine firewall also have to define "Network".
For custon "Network":
gcutil --project=yourproject addfirewall --allowed=tcp:22 default-ssh --network yournetwork
Upvotes: 0
Reputation: 4688
The Compute Engine firewall blocks all traffic unless there is a rule to allow it. The most common issue is missing the default firewall rule which allows SSH. To add it back, run:
gcutil --project=myproject addfirewall --allowed=tcp:22 default-ssh
If that isn't it, there is some good advice for troubleshooting SSH connection issues in the docs: Troubleshooting SSH errors
Upvotes: 7