Skip to content

GitHub SSH key authentication

GitHub SSH key authentication is a secure method used to connect a local Git environment with a GitHub repository. Instead of using HTTPS and a password every time, this method utilizes a cryptographic key pair for identity verification^[600-developer-tools-git-github-sshkey.md].

Key Generation

To set up SSH authentication, a user must generate a new SSH key. The standard command uses the RSA algorithm with a bit length of 4096^[600-developer-tools-git-github-sshkey.md]. The command typically requires an email address as a label (comment) for the key^[600-developer-tools-git-github-sshkey.md].

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

On Windows systems, these keys are typically stored in the .ssh directory within the user's folder^[600-developer-tools-git-github-sshkey.md].

Configuration

Once generated, the key needs to be added to the local SSH agent and registered with the GitHub account. Official documentation provides a step-by-step guide for generating keys and adding them to the SSH agent^[600-developer-tools-git-github-sshkey.md]. Additionally, GitHub settings provide a specific interface where the public key must be uploaded to authorize the connection^[600-developer-tools-git-github-sshkey.md].

Sources

^[600-developer-tools-git-github-sshkey.md]

[[Git]] [[Developer Tools]] [[SSH]] [[Public-key cryptography]]