Google Cloud Services - unable to SSH into instance at all

Google have developed a troubleshooting script for VM instances having problems with SSH connectivity. Here is the link: https://github.com/GoogleCloudPlatform/compute-ssh-diagnostic-sh


One of the reasons for receiving this error is that the firewall rules for the VPC are not configured to allow SSH ingress access to the instance. You can validate this configuration in the Google Cloud Console:

  1. Go to the project that your VM is active in
  2. Using the left side popout menu, select 'VPC network'
  3. Click on Firewall rules
  4. Check for a rule that allows SSH access via TCP on port 22 with a target that is inclusive of your instance or 'Applies to all'
  5. If the rule is missing, create the firewall rule, for the 'Source IP Ranges', enter the public IP address of your Internet connection or enter 0.0.0.0/0 to allow connections from anywhere on the Internet