SSH to GCP + Github

In this section, we will configure an SSH key to connect to GCP.

there are multiple reasons to do so.

  1. you will use the connection to clone your codebase into GCP

  2. you will use the connection to connect to GCP on your laptop terminal

  3. you will use the key to connect with filezilla to enable file transfers.

this link gives a good detailed explanation on how to set up.

Step 1 : Create your SSH key (for github) to connect to your laptop

you can repeat the same process from your cloud console to connect your instance to github

creating SSH key on my local machine

Adding your SSH key to the ssh-agent

After you create your keys, you need to add the key to your SSH agent to be recognized in your laptop.

Add your SSH private key to the ssh-agent and store your passphrase in the keychain.

adding SSH key on my local machine

adding SSH key in GCP Instance console

After you complete this process, add the public key into your github setting

how to git clone your codebase

When your key is added into github, make sure you add the key to your SSH-Agent in order that it is recognized.

when the Identity is added, you can proceed to clone your codebase

git clone [email protected]:UnitCode-org/Unit-Network-Chain.git

Clone codebase into your GCP

Add the PUBLIC key to your GCP instance

the next step is to add your public key to your GCP instance so that GCP will recognize your key and allow you access to the instance.

Click on your instance and go into the next screen which shows the details of your instance.

select your instance by clicking on the name (in this case vivaldi)
click EDIT and scroll down to find the section to add the SSH key

add the PUBLIC key you have just created here

when you have successfully set up the key, you will see this

setting up your SSH key on github

Last updated