Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up ssh keys in Google Compute Engine?

I am trying to set up ssh keys through the Google Cloud Platform console. I made a key in Puttygen, but what is the format to paste it into the console? I got this error:

Error: Invalid key. Required format: <protocol> <key-blob> <[email protected]>
like image 830
Yossi Neiman Avatar asked Jul 16 '14 07:07

Yossi Neiman


People also ask

How do I set up SSH keys?

Open a terminal and use the ssh-keygen command with the -C flag to create a new SSH key pair. Replace the following: KEY_FILENAME : the name for your SSH key file. For example, a filename of my-ssh-key generates a private key file named my-ssh-key and a public key file named my-ssh-key.

How do I enable SSH in GCP instance?

Connect through a browser from the GCP MarketplaceBrowse to the Google Cloud Platform console and sign in if required using your Google account. Find and select your project in the project list. Select the “Compute -> Compute Engine” menu item. Locate your server instance and select the SSH button.

What is SSH keys in GCP?

SSH keys in Google Cloud Platform¶ You need SSH keys to connect to an instance of BIG-IP VE. If you use any of the Google tools (Open in browser window, View gcloud command), Google creates keys automatically for you. BIG-IP VE copies the keys locally while they are valid.


1 Answers

  • After opening puttygen, select SSH-2 RSA and change the number of bits to 2048
  • Click on generate and follow the instructions
  • In the Key Comment textbox, put your email address
  • Fill in the passphrase boxes too for good practice
  • Save your private key somewhere
  • Copy all of the text from the top, greyed-out textbox

You should end up with the following in the google ssh keys textbox

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQB5h1cM5uLB+1C7Al+RNuKoFz81P4mw89pYPDuARzZTNFPguHsfUNZ6Xtq2LF/CDoRh9G3Y9xt12H5TWdeZdmdaokwbtQYba86Ve7w0eLEw0Bwy4eQCC/hsVzNY37pUbdGBMbhOoYfJQ1gnz+4kZBtgNlk3PQiyWkBzBcIt6qHgd/ax8mS8Ty+0/cD1X50yEzyr/anP/WowZYIDb5rtM/+Rb/qZ6wZl1ka+AulT+9cH59ChHLDzeZc6NdJYhmS6K5DDebRaRWdviOiI+RpSMZz0hsHaGnQdpfrzswIwPolrA+nKQ24WZDPgWAzCAlvuLRdYB3dGDkLCnypAfHzwGyTj [email protected]

Then open putty, fill in the Session details and then go to Connection -> SSH -> Auth and click browse under Private key file for authentication.

After clicking open, your login name is the user part of your email address (before the @). It will ask you for your passphrase too.

like image 185
Daryl Van Sittert Avatar answered Sep 28 '22 19:09

Daryl Van Sittert