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
- Generate your keys using ssh-keygen
- Copy the content of your public key
- Log in to the Console
- Add your key to the project metadata:
- Click on the Metadata page
- Enter “sshKeys” the blank key box (use this exact name)
- 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.
- Save your changes.
- Click Add metadata to save your changes. It may take several minutes before the key is inserted into the instance.
Step 2: Launch
- Launch a VM, make sure to open the right firewall ports on your network
Step 3: Connect
- 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
I know GCE is not that easy yet, so if you have questions, don’t hesitate to contact us at email@example.com