1

I am trying to connect virtual machine VM_1 in project_A to virtual machine VM_2 in project_B. Bot are on Debian Linux.

Steps I did:

On VM_1 Project_A

Generated private and public keys

ssh-keygen -t rsa -f ~/.ssh/my-ssh-key -C example-user $ chmod 400 ~/.ssh/my-ssh-key

In a browser, Metadata page of project_B. Clicked SSH Keys to show a list of project-wide public SSH keys and added public keys that I created from VM_1 Project_A Now the keys are added I tried ssh from virtual machine VM_1 on Project_A to Vm_2 on Project_B

it is giving below error

Permission denied (publickey)

Please advise

abhi
  • 21
  • 4

1 Answers1

0

It seems a bug that I can not apply public key to a particular VM in a project. I was able to connect it by applying public ssh key to whole project.

abhi
  • 21
  • 4
  • There are [Google Daemons](https://github.com/GoogleCloudPlatform/compute-image-packages/tree/master/google-daemon) running on the instance responsible for propagating the user accounts and ssh keys from metadata to the instance. With that said, have you added the ssh-keys to the instance metadata they will not be propagated to other instances in the same project. You can refer to this [link](https://cloud.google.com/compute/docs/instances/connecting-to-instance) for more information on how to setup ssh for GCE instance. – Faizan Apr 21 '16 at 18:01