How to connect with (SSH) Putty to CentOS on GCE

AllCloud Blog:
Cloud Insights and Innovation

Google has recently released their IaaS (Infrastructure as a Service) which enable users to launch virtual machines on the Google Cloud Platfrom, I’ve got lots of questions how to setup the login username (since root login is not allowed on gce centos) and keys to CentOS machines on GCE and simply connect with Putty other than GCUTIL which requires either Cygwin on Windows or Linux with Python 2.7

As a big fan and heavy user of AWS, here are my steps to do so, not to worry its very easy

Step 1: Keys setup

  1. Generate your keys using ssh-keygen
  2. Copy the content of your public key
  3. Log in to the Console
  4. Add your key to the project metadata:
  5. Click on the Metadata page
  6. Enter “sshKeys” the blank key box (use this exact name)
  7. In the corresponding Value, enter a value for the ssh key in the following format: <username>:<public_key>
    This makes your public key automatically available to all of your instances in that project. To add multiple keys, list each key on a new line, as demonstrated above.
  8. Save your changes.
  9. Click Add metadata to save your changes. It may take several minutes before the key is inserted into the instance.

Step 2: Launch

  1. Launch a VM, make sure to open the right firewall ports on your network

Step 3: Connect

  1. Connect with Putty using your Private Key to your server, when prompt for a username (login as:) provide the username as your configured in step 7

That’s it

I know GCE is not that easy yet, so if you have questions, don’t hesitate to contact us at

Lahav Savir

Founder and CTO, Cloud Platforms

Read more posts by Lahav Savir