We have two compute engine instances(both Linux VM's) on one Project. One I had access through Putty and it was connecting fine. But the other instance I had the "Server Refused our Key" error when trying to connect through putty. In trying to fix the issue with the one giving the error, I removed all ssh keys in the Metadata and used a new key on the Compute engine and now I'm having the issue on both instances. These are our production servers so we need the access. Other than changing out the SSH Keys, I haven't tried much else. I'm limited in Knowledge.

  • I got connection back the VM instance that was working fine before. Feb 26, 2019 at 17:18

2 Answers 2


I read the answer on other issues here, but none described the solution well enough for me to follow.

I was able to gain access to the VM instance by...

  1. Go to the Compute Engine in the Project
  2. Click on the "SSH" button for the VM
  3. Wait for the SSH console to open and connect in a browser window
    1. You may have to allow browser popups
  4. Make sure you are in the home directory by typing pwd
  5. Create the .ssh directory with mkdir ~/.ssh
  6. Change the directory with cd ~/.ssh
  7. Create/append the file authorized_keys with the OpenSSH text echo "ssh-rsa <public-key> <username> >> authorized_keys

After I did these steps I was able to get into the VM instance using putty.


I had this issue and the root cause was confusing my full email w/ my username, after deleting off @gmail.com from my username in putty - wha-la - no more refused key and I got into my GCE instance via windows/putty.


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.