Created
October 27, 2019 02:38
-
-
Save timbophillips/d31a38efc7c29add955198550c7554d0 to your computer and use it in GitHub Desktop.
Adding a new SSH key to your GitHub account - using PowerShell on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host " | |
This script performs the steps from | |
https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent | |
1. generate a ssh key | |
2. start the ssh-agent service | |
3. add the key to the agent | |
4. copy the public key signaturecopy it to the clipboard | |
" | |
$email = Read-Host -Prompt "enter your GitHub email address" | |
ssh-keygen -t rsa -b 4096 -C $email | |
Start-Process -filepath powershell.exe -Verb Runas -ArgumentList @('Set-Service -StartupType Manual ssh-agent') | |
Start-Service ssh-agent | |
ssh-add $HOME\.ssh\id_rsa | |
Get-Content $HOME\.ssh\id_rsa.pub | clip.exe | |
Write-Host " | |
now head to https://github.com/settings/ssh/new to paste the key in to Github | |
" |
This helped a lot. Thanks 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you @timbophillips it's help me