What's the command to verify SSH keys are properly added for git
? There are 2 sets of keys under our ~/.ssh/
and we want to add both of them. What we did was to run ssh-add -l
in git bash
:
$ ssh-add -l
2048 28:1b:b8:b2:a8:f1:9b:bb:b5:85:21:d5:d8:0b:00:b2 /c/Users/myuser/.ssh/bb_rsa (RSA)
2048 3d:31:e8:f7:f5:cd:dd:c7:0b:84:16:66:23:95:af:05 /c/Users/myuser/.ssh/id_rsa (RSA)
Are those 2 sets of SSH keys shown in command
ssh-add
properly added for git(both public and private)?
We are getting permission denied
when deploying and would like to verify that the keys are added properly.
You need to add only the public keys under your github account.
Set the remote url to ssh protocol if its not set already:
git remote set-url origin <url>
Try to do any remote operation like:
If the ssh is not set correctly you will get an error message.
Note:
On the first operation you might get a question asking you if you wish to add the ssh key to the known hosts. Answer with yes and it will not prompt again.
If you keep getting the Permission denied error?