
Configure SSH for GitHub
Why Use SSH
While both HTTPS and SSH can be used to interact with Git repositories, they have different strengths and weaknesses. The following are some strengths of using SSH.
- Security: SSH utilizes a public key authentication, which is considered more secure than the typical username/password authentication used by HTTPS
- Convenience: Once you set up SSH, you don't need to enter credentials every time you interact with a repository.
- Automation: SSH is ideal for use with automated scripts and workflows
Create SSH Key for GitHub
- Create a new SSH key by using this command
ssh-keygen -t ed25519 -C "your.email@childrensnational.org"
- Enter the location and name of the key, i.e C:\Users\
/.ssh/keyName - Enter a passphrase
- Re-enter the passphrase
Add SSH Key to the ssh-agent
- Open shell terminal with elevated privileges
- Use the following command to start the ssh-agent service
# start the ssh-agent in the background
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
- Add your ssh key to the ssh-agent
ssh-add c:/Users/YOU/.ssh/YOUR_SSH_KEY_FILENAME
Add Your SSH Key To Your GitHub account
- Open c:/Users/YOU/.ssh/YOUR_SSH_KEY_FILENAME.pub in a text editor and copy the contents
- In the upper right corner of GitHub, click on your profile photo and select Settings
- In the Access section, click on SSH and GPG keys
- Click New SSH key
- Enter a descriptive title in the Title field
- Paste the copied key data into the Key field
- Click Add SSH Key
- If prompted, confirm access to your GitHub Account