Skip to content

Instantly share code, notes, and snippets.

@coolnikhilmaurya
Created June 11, 2020 17:08
Show Gist options
  • Save coolnikhilmaurya/7d97a12fbe9a1f06120375e29b5b7dbd to your computer and use it in GitHub Desktop.
Save coolnikhilmaurya/7d97a12fbe9a1f06120375e29b5b7dbd to your computer and use it in GitHub Desktop.
Connect to GCP Compute engine via SSH locally in Ubuntu
1. Generate ssh public private key-pair *you can skip everything just enter to create with default without pass
ssh-keygen -t rsa
2. show public key
cat ~/.ssh/id_rsa.pub
3. copy the output public key and paste into cloud console dashboard GCP -> Compute Engine -> Metadata -> SSH keys (tab)
now you can connect your server locally with ssh
ssh username@external_ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment