To generate, check and add ssh keys in Windows with PowerShell:
Open PowerShell with Win + X then click on "Terminal (administrator)".
To generate a key use:
ssh-keygen -t rsa -b 4096 -C « [email protected] »
-t specifies the type of encryption, -b the strength of encryption, and -C is the email attached to the account you want to be able to access with your key.
It's supposed to be stored by default in C:\Users\yourusername/.ssh/id_rsa , and you should find a yourkey file and a yourkey.pub file there.
To display your public key from the terminal do this:
cat yourkey.pub
To check if the SSH agent is running do:
Get-Service ssh-agent
If it's not running, do this to set it up manually:
Get-Service ssh-agent | Set-Service -StartupType Manual
Then:
Start-Service ssh-agent
To check the keys already added to your ssh agent do this:
ssh-add -L
And to add your key, do this:
ssh-add yourkey
ssh-agent
and add private keys to it, which script I found through VonC's answer. I recommend you use it, and I reference it in my own answer here: How to getssh-agent
to load your private ssh keys and require their passwords only once per boot in Windows – Grillo