kashminder
kashminder

Reputation: 149

ssh google compute engine instance from ubuntu

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

Upvotes: 1

Views: 259

Answers (3)

Jonathan
Jonathan

Reputation: 76

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.

Upvotes: 0

Alioua
Alioua

Reputation: 1776

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.

Upvotes: 0

codyc4321
codyc4321

Reputation: 9682

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.

Upvotes: 0

Related Questions