1

There are a multiplicity of articles on the web about setting up SSH on Google compute engine for Linux instances but a lack of ones describing how to successfully generate them for a windows instance.

I have created keys using

gcloud compute ssh instance name

where the instance is a windows 2008 server. I understood that the keys would be found under %user%/.ssh but no such luck. I can find them nowhere on the windows server instance. How do I successfully create keys for windows server in google's compute engine.

Norco
  • 11
  • 1
  • 3

2 Answers2

1

Your question is not very clear, however I'll try to answer it.

By default, no SSH service is running on the GCE Windows instances. If you're trying to connect to a Windows instance via SSH, then first you'll need to install and configure a SSH server (daemon) on your Windows VM.

However, if you're trying to SSH to a Linux VM from your Windows VM, first use gcloud auth login to authenticate your account. Then run gcloud compute ssh INSTANCE , where INSTANCE is the target Linux VM.

In this case, the SSH keys will be created and you can find them in the %users%\.ssh\ folder of the Windows.

Kamran
  • 1,425
  • 7
  • 17
0

I could not get the SSL keys generated by GCE to be automatically transferred to the Windows server instance as happens with a Linux instance. To resolve the need to have the GCE and Windows keys the same I created the key on the windows system and copied it to the GCE console.

Steps

  1. Download puttygen.exe and create a new key, make sure to use a password in order to protect it,
  2. Save the private and public keys for use on the Windows Machine to a location of your choosing.
  3. Copy the private key from the puttygen interface
  4. Use a browser to login to the GCE console
  5. Select your project, then go to Compute / Compute Engine / Metadata in the menu panel on the left side
  6. Select SSH keys from the menu at the top
  7. Click Edit and click in the ssh key field of the user key you wish to edit (usually the one corresponding to the a user on the Windows instance). If there are no keys you will have to click the plus sing to add a new user/key combination.
  8. Make a note of the email address at the end of the existing key
  9. Delete the existing key and paste the one you copied from the puttygen.exe panel on the Windows instance.
  10. Make sure to remove the comment at the end of the new key and replace it with address you noted in step 8. It should match the user of the key you are editing.
  11. Click save -- You are done. you just have to finish off in the windows box to make sure the application you are connecting to is using the key you generated.
Norco
  • 11
  • 1
  • 3