title: GCP VM Instance - OS Login as another user
body: <p>I am trying to connect to a VM as another user through the command line on my local computer, however it doesn't seem to work.
  I remember doing this before with the same command:</p>
  
  <pre><code>gcloud compute --project MYPROJECT ssh usernameA@vminstance --zone "myzone"
  </code></pre>
  
  <p>I am getting a warning and then get connected as myself not usernameA</p>
  
  <pre><code>WARNING: Using OS Login user [usernameB] instead of default user [usernameA]
  </code></pre>
  
  <p>According to GCP <a href="https://cloud.google.com/sdk/gcloud/reference/compute/ssh#USER" rel="nofollow noreferrer">documentation</a>, this should work but I can't recall if I need to change any of the config settings</p>
  
  <p>EDIT:
   I have generated a key and added it to the VM Instance ssh keys and still get the same warning.</p>