To generate a new ssh key with the Ed25519 algorithm as recommended in the GitHub Docs paste the following powershell commmand:
> ssh-keygen -t ed25519 -C "comment of your choice"
-
Set the Startup Type of the ssh-agent to Manual
> Get-Service -Name ssh-agent | Set-Service -StartupType Manual
-
Start the ssh-agent
> Start-Process ssh-agent
-
Add the private key to the ssh-agent
> ssh-add ~/.ssh/id_ed25519
-
Set the Windows OpenSSH Client as the default SSH Client to use the ssh-agent configuration
> git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
-
Copy the public key
> cat ~/.ssh/id_ed25519.pub | clip
-
Go to your Github Account Settings and add a new SSH key with a suiting title (for example the PC Name) and paste the public key.
-
Verify if the SSH Key is loaded into SSH
> ssh-add -l
If everything worked you should see the public key fingerprint.
-
Verify the connection to GitHub
> ssh -T [email protected]
After accepting the fingerprint you should see a message containing:
You've successfully authenticated
.
In case that anything went wrong check out the GitHub docs.
-
Press Windows Button + R and paste the following:
shell:startup
-
In the opened folder create a symlink to the ssh-agent
> New-Item -ItemType SymbolicLink -Path "Enter Path to Startup Folder Here" -Target "C:\Windows\System32\OpenSSH\ssh-agent.exe"
That's it. You should now be able to push to repos without being prompted to type your username or password.