title: Why Google Cloud Compute Engine instance gives ssh connection refused after restart?
body: <p>I stopped and restarted an ubuntu 14.04 Google Cloud Compute Engine instance, and now my ssh connection is refused with:</p>
  
  <p><code>ssh: connect to host 146.148.114.98 port 22: Connection refused</code></p>
  
  <p>This already happened a previous time, I thought there was a problem with the machine, I deleted it and recreated and it started working again. I don't want to be recreating instances every time. The ssh troubleshooting page of google cloud is quite messy. My firewall rules seem to be ok. Anyone has a solution for this?</p>
  
  <pre><code>NAME                    NETWORK  SRC_RANGES    RULES                         SRC_TAGS  TARGET_TAGS
  default-allow-http      default  0.0.0.0/0     tcp:80                                  http-server
  default-allow-https     default  0.0.0.0/0     tcp:443                                 https-server
  default-allow-icmp      default  0.0.0.0/0     icmp
  default-allow-internal  default  10.128.0.0/9  tcp:0-65535,udp:0-65535,icmp
  default-allow-rdp       default  0.0.0.0/0     tcp:3389
  default-allow-ssh       default  0.0.0.0/0     tcp:22
  </code></pre>
  
  <p>This is the output for: <code>ps aux | grep ssh</code></p>
  
  <pre><code>root        29  0.0  0.4  55184  2860 ?        Ss   11:26   0:00 /usr/sbin/sshd -p 22 -o AuthorizedKeysCommand=/google/devshell/authorized_keys.sh -o Author
  izedKeysCommandUser=root
  root       183  0.0  0.9  82692  5940 ?        Ss   11:26   0:00 sshd: fbeshox [priv]                                                                       
  
  fbeshox    218  0.0  0.7  82692  4424 ?        S    11:26   0:00 sshd: fbeshox@pts/0                                                                        
  
  fbeshox    522  0.0  0.3  12728  2200 pts/1    S+   12:12   0:00 grep ssh
  </code></pre>
  
  <p>Here the verbose results of the ssh connetion attempt.</p>
  
  <pre><code>ssh -i .ssh/keyname username@130.211.53.51 -vvv
  OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
  debug1: Reading configuration data /Users/xxxx/.ssh/config
  debug1: Reading configuration data /etc/ssh_config
  debug1: /etc/ssh_config line 20: Applying options for *
  debug1: /etc/ssh_config line 102: Applying options for *
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to 130.211.53.51 [130.211.53.51] port 22.
  debug1: connect to address 130.211.53.51 port 22: Connection refused
  ssh: connect to host 130.211.53.51 port 22: Connection refused
  </code></pre>