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 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...
- Go to the Compute Engine in the Project
- Click on the "SSH" button for the VM
- Wait for the SSH console to open and connect in a browser window
- You may have to allow browser popups
- Make sure you are in the home directory by typing
- Create the
- Change the directory with
- Create/append the file
authorized_keyswith 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.