I am using Google Compute engine to host couple of sites but I resize the disk and then restarted the instance and now I am unable to connect both from gcs and putty. ( Connection Refused )

Serial console output: http://pastebin.com/BZicx7JN

how can I troubleshoot this ?.

  • 1
    Before checking the console output I would wait for it to finish booting. – Michael Hampton Jan 1 '17 at 6:52
  • The output of the serial console does look incomplete. Did you follow these steps to resize the disk? Did you get any errors or did anything differently? I would suggest confirming that you have a valid file system and MBR record as explained in this article – Carlos Jan 3 '17 at 19:39
  • have you checked you firewall rules, i think you have delteed the rule that give access to to your instance at port 22. – Sudhanshu Gaur Jan 26 '17 at 17:17
  • 1
    Were you ever able to solve this issue? If so please consider posting a self-answer so the community can benefit. – Faizan Feb 3 '17 at 20:22
  • Try by using different internet connection. Your ISP might not allowing port 22. – Nishant Jun 16 '18 at 12:55

I had the same issue with one of my GCP VM instance. My solution was:

  1. Shut down the instance
  2. Click 'Edit' for the instance
  3. Under 'Custom Metadata' section, add 'startup-script' key, with value:
#! /bin/bash
sudo ufw allow 22
  1. Click 'Save'
  2. Start the instance again, and SSH into it

Hope it helps!

| improve this answer | |

General recommendation to troubleshot this issue.

  • Make sure the disk resize is done properly. Detailed steps are documented here.
  • Confirm the instance has fully booted up. You can confirm this through VM serial console output.
  • Once the instance is booted confirm if ssh daemon is running. Serial console output will have information about ssh daemon. If ssh service is not running you can use interactive serial console to start the service.
  • Make sure you have firewall rule configured in GCE network to allow ssh port.
  • Make sure firewall on the instance(e.g. iptables) is allowing the ssh port. You can use interactive serial console to disable firewall on the VM, if required.
| improve this answer | |
  • What information In VM serial console output can confirm the instance has fully booted up? What information In VM serial console output can confirm the daemon is running? – niaomingjian Jan 12 '18 at 2:24

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.