简体   繁体   中英

Google Cloud Platform: ssh from VM_1 in project_A to VM_2 in project_B

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

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

In a browser, Metadata page of project_B.

  1. 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 error

Permission denied (publickey)

Please advise

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM