2

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

Igl3
  • 4,900
  • 5
  • 35
  • 69
user1578301
  • 85
  • 2
  • 7

6 Answers6

4

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.

Community
  • 1
  • 1
Thomas Orozco
  • 53,284
  • 11
  • 113
  • 116
0

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

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
0

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

fAX
  • 1,451
  • 1
  • 10
  • 11
0

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)

0

try with

gcloud compute ssh "instanse"

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

Levan Lacroix
  • 25
  • 1
  • 8
0

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 myname@gmail.com (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.

Jonathan
  • 76
  • 1
  • 5