After clearing a project and instance of SSH key metadata and running gcloud compute ssh (which will create a new key pair and update project metadata), I am no longer able to SSH in without getting the "ssh: connect to host ..*.133 port 22: Connection refused" error.

I have read through every forum I can find involving this issue, yet I cannot come to a solution. I am even unable to connect through cloud shell terminal.

Is there something blatantly wrong with what I did?


Did you check the firewall rules? You have to allow the port 22 for your instance


You can check if the instance is open to connections on port 22 by running sudo nmap -Pn -p 22 <instance IP>.

If you have the port 22 is open in the instance you should check in the serial console output for error in the sshd.

If there are no errors, try testing connectivity to the instance by using telnet IP 22. You should get the SSH prompt. When testing try the internal IP and the external one (if you have one). This would discard that the service is down in the other instances. You might also try connecting to the other VMs using the browser or the serial console to verify the service is status.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.