Silver Ringvee
Silver Ringvee

Reputation: 5545

None of the SSH connection options are working

There seems to be no option to connect to a compute engine instance using SSH.

Here's what I've already tried:

Cloud Console In-browser SSH

Error:

The VM guest environment is outdated and only supports the deprecated 'sshKeys' metadata item.

Cloud Shell using GCloud command

Command:

$ gcloud compute --project "reflective-data" ssh --zone "us-central1-a" "instance-1"

Error:

Permission denied (publickey).
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

Google Cloud SDK Shell

Command:

$ gcloud compute --project "reflective-data" ssh --zone "us-central1-a" "instance-1"

Error:

[PuTTY Fatal Eroor] Disconnected: No supported authentication methods available (server sent: publickey)

After all of these failed, I also tried deleting all ssh-keys for the instance and later also for the project. The errors remain the same.

Firewall settings:

enter image description here

Upvotes: 0

Views: 461

Answers (2)

Polyvinyl
Polyvinyl

Reputation: 51

Here is an alternative method that has worked for me:

Windows / PuTTY

  1. Open PuTTYgen
  2. Click start
  3. Create randomness, by moving your mouse
  4. For the key comment type in the username of your VM
  5. Click Save Private Key (end the file name in .ppk)
  6. Click Save Public Key (end the file name in .pub)
  7. Back in Google Cloud's Console: Click on your instance name
  8. Click 'Edit'
  9. Scroll down to 'SSH'
  10. Where it says "enter entire key data: Paste
  11. Save

Mac / Terminal

Create the SSH Key

In the terminal type ssh-keygen -t rsa -f ~/.ssh/{filename} -C {username}

Upload the Public Key to your VM

  1. In the terminal type cat ~/.ssh/{filename}.pub
  2. Copy the results to the clipboard
  3. Back in Google Cloud's Console: Click on your instance name
  4. Click 'Edit'
  5. Scroll down to 'SSH'
  6. Where it says "enter entire key data: Paste
  7. Save

Upvotes: 0

Simon So
Simon So

Reputation: 107

Have you tried to create a separate SSH key pair, and then edit the GCE instance's metadata to add the public key (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#instance-only) and then try the connection again?

Upvotes: 0

Related Questions