github

Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to Github without supplying your username and personal access token at each visit.

Steps to check SSH is installed

First of all, check if you already have an SSH key! 1. Open Git bash.
2. Use the following command:
$ ls -al ~/.ssh

Next, If you don’t have any SSH keys, we’ll proceed to generate a new SSH key for authentication.
1. Open Git bash.
2. Use the following command:
$ ssh-keygen -t ed25519 -C "<your_email_address>"

This creates a new SSH key.
3. When you’re prompted to “Enter a file in which to save the key”, press Enter. Thus, It’ll store in the default location.
4. At the prompt, type a secure passphrase or keep it empty for no passphrase.

Now, it’s time to add this new SSH key to your Github account!

  1. Copy your public key.
  2. In the browser, go to your Github account. Click on the your profile picture in the upper right corner of the page.
  3. Go to settings. In the user settings, click on “SSH and GPG keys“.
  4. Click on “New SSH key”.
  5. Paste your copied key in the textbox.
  6. Click on “Add SSH key” button.
  7. Now, You’re key is successfully added to your Github account.

Last but not the least, Test your SSH connection.

  1. Open Git Bash.
  2. Use the following command:
$ ssh -T git@github.com

You’ll receive a message saying you’re authenticated or permission denied!

You can also check How To Add GIT Submodule?

8 thoughts on “Connecting To Github With SSH”
  1. another workaround , generate a PAT from git, create ~/.netrc file , put below into the ~/.netrc file
    machine github.com login password
    happy git pull

Leave a Reply

Your email address will not be published. Required fields are marked *