0

Introduction

I would like to trigger a Compute Engine remotely using gcloud for a bussiness process, from the documentation I see that it can be done with this command, which is a wrapper of the next command that I would like to use instead of installing the gcloud SDK.

ssh -i ~/.ssh/gcloud_ce <instance_name>@<vm_ext_ip> 'ls' to execute the ls command from my PC, but I am only welcomed by Permission denied (public key).

What I am missing to configure and achieve this goal?

Similar case, but the solution did not work for me

1 Answers1

0

Here's the following steps you can refer to for the Permission denied (public key):

  1. Generate ssh key using ssh-keygen

  2. Copy the key.pub file contents

  3. Append the contents to ~/.ssh/authorized_keys file sudo nano ~/.ssh/authorized_keys

  4. Try to ssh the VM on your client.

you can also refer to this documentation on Choosing an access method and SSH Permission denied (publickey) on GCE

かいぜん
  • 327
  • 2
  • 9
  • 1. Created a new public key on my Windows machine 2. Addded the public key to the VM instance to the authorized_keys 3. Tested the ssh command 4. Same error – BadProgrammer Nov 18 '22 at 09:41
  • have you tried to generate a `non-root` key maybe you are using a `root` SSH key, also edit your post and provide a screenshot of the error message. – かいぜん Nov 18 '22 at 19:58