To SSH into an instance using your own terminal (as opposed to the Google Cloud Platform console), you must generate and upload an SSH key.
- Generate an SSH key using the following command:
$ ssh-keygen -f ~/.ssh/my_gcp_keyname -t rsa
This generates a public/private key pair.
- In the Compute Engine menu, click Metadata.
- Click the SSH Keys tab and click Add SSH Keys.
- Copy your key data into the input box in the following format:
protocol public-key-data email@example.com
- Click Save. Your public key is now available to all instances in the project.