Intro

ssh diagram SSH is a cryptographic network protocol for operating network services securely over an unsecured network. Its most notable applications are remote login and command-line execution.


Access remote systems using SSH


Connecting to GitHub with SSH

On your local machine, you can create an SSH Key and link it with GitHub to enable authentication for Git operations over SSH. This eliminates the need to enter your GitHub username and password for every operation (e.g. cloning, pushing, or pulling a repository)

An SSH key is a cryptographically secure identifier. It’s like a really long password used to identify your machine, which can be used by GitHub without having to type in your username and password every time. ssh

Check for Existing SSH Keys

ls ~/.ssh/id_ed25519.pub
  • If you get a message like “No such file or directory”, then you do not yet have an Ed25519 SSH key

Create an SSH Key

  • Run the following command in the terminal to create a new SSH key using your GitHub email as a label:
ssh-keygen -t ed25519 -C "your_email@example.com"
> Generating public/private ed25519 key pair.
  • When prompted, you can press Enter to accept the default (~/.ssh/id_ed25519).
> Enter file in which to save the key (/c/Users/YOU/.ssh/id_ALGORITHM):[Press enter]
  • Show the SSH key and copy it to your clipboard for the next step:
cat ~/.ssh/id_ed25519.pub

Add the SSH key to your GitHub account

  • In GitHub, navigate to Settings SSH and GPG keys New SSH Key:

  • Name the key with a useful description of where it came from.

  • Use the output of cat ~/.ssh/id_ed25519.pub and paste it the Key section picture 2

  • Confirm that your SSH key is connected to your GitHub account

ssh -T git@github.com
  • if successful, you should see:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.