Tags
Published
Jan 4, 2023
noBg
noBg
If you received the
“Support for password authentication was removed on August 13, 2021”
error message, consider setting up SSH access to GitHub.ℹ️ Text in angle brackets "< >" are supposed to be replaced with your own information
Generate SSH Key
- Open Terminal / Git Bash / PowerShell
- Enter this command to generate a SSH Key
ssh-keygen -t ed25519 -C "<Your_GitHub_Email_Address>"
If you are using a legacy system that doesn't support the Ed25519 algorithm, use
ssh-keygen -t rsa -b 4096 -C "<Your_GitHub_Email_Address>"
- When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location
> Enter a file in which to save the key (</PATH/TO/KEY>): [Press enter]
- At the prompt, type a secure passphrase
You will need to enter this passphrase every time you use your SSH Key
Optionally, you can leave it empty and press enter
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
Obtain Public Key
The output should include the following two lines:
Your identification has been saved in </PATH/TO/KEY>
Your public key has been saved in </PATH/TO/KEY>.pub
Use the
cat
command to display the content of your public key:cat </PATH/TO/KEY.pub>
The output should look like:
ssh-ed25519 ****** <Your_GitHub_Email_Address>
Select and copy this to your clipboard.
Add Public key to GitHub Account
- In the
Title
field, add a descriptive label for the new key. (E.g. My MacBook Pro)
- Leave
Key type
as is
- Paste your public key into the
Key
field
- Click
Add SSH key
Using SSH to Clone a Repository
You can now see SSH as an option when you are trying to clone a GitHub repository.
git clone <SSH_URL>
If this is your first time connecting to GitHub with SSH, you may see a warning like this:
> The authenticity of host 'github.com (IP ADDRESS)' can't be established.
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
> Are you sure you want to continue connecting (yes/no)?
Verify that the fingerprint in the message you see matches GitHub's public key fingerprint. If it does, type
yes
.Then, enter your SSH passphrase if prompted.
Update Local Repo Cloned with HTTPS to SSH
If you have cloned an repository using HTTPS already (
git clone <https://github.com/
>), you can set its remote url to the SSH URL.git remote set-url origin <NEW_SSH_URL>