1
votes

I am not able to access the google compute engine instance using ssh or gcutil ssh. I have tried adding my local machine keys into metadata and shh keys of the specific instance. How to achieve access using a shh-client?

this is the link to the guides i followed.

Google Compute Engine - troubleshooting SSH "Connection refused"

https://cloud.google.com/compute/docs/instances/connecting-to-instance#standardssh

3
Is there any documentation you've followed that says how to ssh access the compute engine instance? And what are your errors? Connection refused? Host unreachable?OneCricketeer
using this cmd gcutil ssh --project ; getting error ; Permission denied (publickey). using ssh root@IP ; getting error ; Permission denied (publickey).kashminder

3 Answers

0
votes

the official way is google compute ssh [instance-name]

If this isn't what you did to get the error, let me know and I'll try.

0
votes

Just to let you know Google Compute Engine recommends that all users transition to the gcloud compute tool from gcutil. gcloud compute is a unified command-line tool that features a number of improvements over gcutil link.

To connect to Google compute Engine you need tor run the below command in your cloud Shell:

gcloud compute ssh [INSTANCE_NAME]

Here a the public documentation, If you want to ssh from inside an instance just run the same command line above.

0
votes

The trick here is to use the -C (comment) parameter to specify your GCE userid.

If the Google user who owns the GCE instance is [email protected] (which you will use as your login userid), then generate the key pair with (for example)

ssh-keygen -b521 -t ecdsa -C myname -f mykeypair

When you paste mykeypair.pub into the instance's public key list, you should see "myname" appear as the userid of the key.

Setting this up will let you use ssh, scp, etc from your command line.