Today i've suffered some issue with a SSH key. I've tried to clone my repository from Gitlab.com.
Unfortunately i've received an error:
Permission denied (publickey,keyboard-interactive)
I've thought, i have problem with a SSH key. Unfortunately, adding a SSH key did not resolve the problem.
How to resolve it?
The problem exists inside the file below:
By default, the configuration inside this file looks like this:
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa
If you are using only id_rsa key, there is no problem.
The real fun starts, when you want to add the second SSH key. As you can see IdentityFile works here only with one filename.
To add second key for a new host, just add the new record:
Host gitlab.com User firstname.lastname@example.org Hostname gitlab.com IdentityFile ~/.ssh/id_ed25519