GCP : SSH to local instances through a Bastion host

Hi Folks, I came through this issue just today and could clarify after messing around a good amount of time.

  1. Generate a SSH pub/pvt key using putty.
  2. Put the public key to GCP global metadata.
  3. Save the putty pvt key in OpenSSH format.
  4. Save the putty pvt key in putty RSA format.
  5. Connect to the bastion host with through putty (using the generated user).
  6. Upload the OpenSSH converted pvt key to the GCE instance
  7. Change permission of the file,
    1. chmod 600 <key-file-name>.
  8. SSH to the other instance with the above keyfile.
    1. eg: ssh -i <key-file-name> user@instance-name
  9. That’s it. You are in!!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑