title: Setting up external authorized_keys on Google Compute
body: <p>I am moving from AWS and I am using ansible for deployments to a Google Cloud compute instance. I am trying to setup a few users on the box with authorized keys. This used to work for AWS but seems like user management is a little different for Google Compute. Here's what I'm doing.</p>
  
  <p>Created a ssh-key locally. Put this key (public) in ansible files and copying this to a new user created (using ansible) in <code>/home/deploy/.ssh/authorized_keys</code></p>
  
  <p>I'm still not able to login using this key from my local box.</p>
  
  <pre><code>$ ssh -i ~/.ssh/deploy_rsa deploy@&lt;host&gt;
  </code></pre>
  
  <p>Is there a list of users that are allowed to login to the box? Can I only configure the users to login to box from cloud console?</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>$ ssh -i ~/.ssh/deploy_rsa deploy@&lt;host&gt;
  ... skipped some logs here ....
      Here's SSH logs from client side:
      debug1: SSH2_MSG_SERVICE_ACCEPT received
      debug2: key: /Users/ankit/.ssh/gcloud-rsa (0x7ff1d16105e0),
      debug2: key: /Users/ankit/.ssh/deploy_rsa (0x0), explicit
      debug1: Authentications that can continue: publickey
      debug3: start over, passed a different list publickey
      debug3: preferred publickey,keyboard-interactive,password
      debug3: authmethod_lookup publickey
      debug3: remaining preferred: keyboard-interactive,password
      debug3: authmethod_is_enabled publickey
      debug1: Next authentication method: publickey
      debug1: Offering RSA public key: /Users/ankit/.ssh/gcloud-rsa
      debug3: send_pubkey_test
      debug2: we sent a publickey packet, wait for reply
      debug1: Authentications that can continue: publickey
      debug1: Trying private key: /Users/ankit/.ssh/deploy_rsa
      debug3: sign_and_send_pubkey: RSA SHA256:h+yezPKOVjeA2ZKOAN/1r1GRe2s1nyGKwG6wobm+Vh0
      debug2: we sent a publickey packet, wait for reply
      debug1: Authentications that can continue: publickey
      debug2: we did not send a packet, disable method
      debug1: No more authentication methods to try.
      Permission denied (publickey).
  </code></pre>
  
  <p>The other key the client is picking is from <code>~/.ssh/config</code></p>