2
votes

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?

2
You appear to be referring to Google Compute Engine, not App Engine or Cloud Storage. - Daniel Roseman
yes i was referred but i cant fix this - Kevin - Dhinesh babu

2 Answers

7
votes

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

0
votes

Google Compute Engine firewall also have to define "Network".

For custon "Network":

gcutil --project=yourproject addfirewall --allowed=tcp:22 default-ssh --network yournetwork