user1578301
user1578301

Reputation: 85

Google Compute Engine SSH

I just create new instance and now wan to remote my google compute engine. And when i do this, i have an error like this.

D:\>gcutil --service_version="service_version_name" --project="project_name" ssh--  zone="zone_name" "instance_name"
WARNING: You don't have an ssh key for Google Compute Engine. Creating one now..
.
WARNING: Could not generate compute ssh key: There was a problem running ssh-key
gen: [Error 2] The system cannot find the file specified.

Why it ask file specified? How to fix the problem?

Thanks

Upvotes: 2

Views: 4300

Answers (6)

Jonathan
Jonathan

Reputation: 76

The trick here is to use the -C (comment) parameter to specify your GCE userid. It looks like Google introduced this change earlier this year.

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

Levan Lacroix
Levan Lacroix

Reputation: 25

try with

gcloud compute ssh "instanse"

on windows if you are auth previusly, open a putty windows automatically

Upvotes: 0

Alexander Gaysinsky
Alexander Gaysinsky

Reputation: 161

This issue was fixed last week. Please reinstall your Cloud SDK from https://developers.google.com/cloud/sdk/

Please note that Cygwin is not required any more (we have a native Windows installer)

Upvotes: 0

fAX
fAX

Reputation: 1481

It will succeed when run from cygwin. I suggest this is because ssh-keygen is trying to find /.

Upvotes: 0

user2193989
user2193989

Reputation: 41

gcutil is not very easy to use at Windows. I suggest using puttygen and putty, please follow instructions from Google.

Upvotes: 0

Thomas Orozco
Thomas Orozco

Reputation: 55199

You don't have ssh-keygen installed on your system, so gcutil is unable to generate an SSH keypair.

See this answer for installation instructions (note that this pulls in git too, but that's a way to get ssh-keygen on Windows).


Note on why gcutil is trying to generate an SSH keypair:

You need an SSH keypair to be able to connect to an instance. Launching an instance without a keypair would most likely make it unusable, so the gcutil agent is attempting to generate a new keypair for you.

This is done using the ssh-keygen utility.

Upvotes: 4

Related Questions