Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`ssh -T` to VSTS(Azure Devops) authenticates successfully, but `git clone` fails

I recently created a second key to access Visual Studio Team Services,

ssh-keygen -t rsa -b 4096 -C "[email protected]"

so I now have two keys:

id_github
id_vsts

Both keys seem to have been picked up by ssh: ssh-add -l lists both of them.

Next, I added id_vsts.pub to my VSTS account security. The key was properly added because requesting SSH terminal access authenticates properly:

Authentication for user with identifier "" was successful against account "my_account". 
Shell is not supported.

However, when I git clone ssh://[user]@[host]:22/[repo], it fails!

Your Git command did not succeed.
Details:
        Public key authentication failed.

In an unexpected turn of events, if I use id_github's public key, the clone succeeds. What's going on?

like image 425
aryzing Avatar asked Mar 09 '17 21:03

aryzing


1 Answers

In my case, adding IdentitiesOnly yes to the ~/.ssh/config file for the VSO host did the trick.

like image 167
marius-O Avatar answered Nov 11 '22 08:11

marius-O