Accessing GitHub via SSH

SSH (Secure Shell) is a secure communication protocol used to connect to remote servers. You can use SSH to connect to GitHub and perform various actions on your repositories.

Step 1: Generate SSH Key

  • Open your terminal and run the following command: ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
  • Press Enter for the default file location and don’t set a passphrase.

Step 2: Add your SSH Key to your GitHub Account

  • Log in to your GitHub account.
  • Go to your Settings and select the SSH and GPG keys option.
  • Click on the New SSH key button.
  • Give a title to your SSH key and paste the content of your public key in the Key field.
  • Click on the Add SSH key button.

Step 3: Test your SSH Connection

  • Open your terminal and run the following command: ssh -T git@github.com
  • If the output shows a welcome message from GitHub, you have successfully set up your SSH connection.