How to set up GitHub SSH in Ubuntu with example | ninjasquad
Today’s tutorial demonstrates how to configure GitHub ssh in your Ubuntu 22.04 operating system. We often use git and GitHub for development purposes, so connecting to remote Github is an important step in our development journey.
Follow the below steps to connect your local machine to GitHub remote by configuring the GitHub ssh key.
Create a GitHub SSH key pair with the ssh-keygen command
Adding a password to your private key is completely optional. By default id_rsa file is the private key file, the computer will automatically figure out which one is the default file.
Copy the value of the public SSH key to the clipboard
You can run the below command to see the public key.
cat /home/$USER/.ssh/id_rsa.pub
Login to GitHub and navigate to your account settings
You can see the menu when you hover the avatar at the top right position.
Click on the SSH and GPG keys link on the left-hand side menu and add your new public there by clicking the New SSH Key button
Save your changes and that’s it.
[email protected]:~$ git clone [email protected]:testrepo/repo-imporatn.git
This will pull the files from your private repo to your computer.
Source: Internet