An SSH key is the most reliable way to authenticate with GitHub from within Eclipse. An SSH key is generally specific to the computer on which it is created. This tutorial assumes:
- No SSH key already exists on the computer for the logged in user.
- The user has only 1 GitHub account.
Create an SSH key pair
- Open Terminal (macOS) or Command Prompt (Windows).
- Enter the command:
ssh-keygen
- Leave the default answers for each prompt (just press Enter/Return at each prompt).
Give GitHub a copy of the public key
By default, the SSH key pair is stored in the .ssh
folder in the user folder. For example:
/Users/bhorn/.ssh
(macOS)C:\Users\bhorn\.ssh
(Windows)
macOS hides folders that start with a dot (.). Either navigate to the user folder and show hidden files or open the .ssh
folder directly.
Windows shows folders that start with a dot. Navigate to the .ssh
folder.
Open the public key (the one with the extension pub
) in a text editor (ex: TextEdit/NotePad). If the file has the phrase "PRIVATE KEY"
at the top, close it and open the other file.
The link below leads directly to the GitHub new SSH key screen. Alternatively, the GitHub Settings menu can be accessed from the top right corner of the website. The option is “SSH and GPG keys.”
https://github.com/settings/ssh/new
The Title is usually the computer associated with the key. The Key type is Authentication Key. The Key is the text shown when the public key file is opened.
SSH key generation video
The 2 links below are to the same video of an SSH key being generated and shared with GitHub. The YouTube version might show ads (YouTube’s, not mine). The Google Drive version should not show ads.