Site icon Voina Blog (a tech warrior's blog)

Connect to github with ssh key

Advertisements

This is a straight forward list of steps to connect to github with a ssh key instead of user/password.

I am using Linux on my development machine so things are quite easy with ssh.

STEP 1: Create a ssh key

# ssh-keygen -t rsa -b 4096 -C “george@voina.org”

STEP2: Add the key to the authentication agent

# ssh-add ~/.ssh/id_rsa

STEP 3: Display the public key

# cat .ssh/id_rsa.pub

STEP 4: Copy the public key to the clipboard

STEP 5: Import the key to the github.com account

Click on the profile icon -> Settings

Then under “SSH and GPG keys” in tge SSH Keys paste the New key from the clipboard

STEP 6: Clone a private repo using the new key

# git clone git@github.com:voinageo/myapp.git

All done , from now on any git operation using the private repo from github will no longer ask for user/pass but will use directly the secure connection using the ssh key.

Exit mobile version