4

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.

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

3 Answers 3

4

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.

1

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.

1
0

I found the easiest way to get this to work is to click on the arrow next to SSH in the console, press "View gcloud command", then let it autogenerate keys and use those

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .