I recently created a second key to access Visual Studio Team Services,
ssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"
so I now ha
You need to force the client to use specific private key, otherwise it uses the default one.
To check which private key file used for a host, you can run
ssh -v [host(e.g. test@test.visualstudio.com)]
One way is that you can configure it in the config file. (My steps for windows)
touch .ssh/config
if there isn’t config file in .ssh foldercode:
Host xx.visualstudio.com
IdentityFile /c/Users/xx/.ssh/id_vsts
Git clone
commandAnother way is that, you can run ssh -i /path/to/id_rsa user@server.nixcraft.com
command.
More information, you can refer to this article: Force SSH Client To Use Given Private Key (identity file)
Apparently git uses only the first key provided, if that fails, git clone fails. My ssh config had a wildcard option with a key matching before the git key and therefore it did not work. After moving the git configuration to the top of .sss/config all is fine.
In my case, adding IdentitiesOnly yes
to the ~/.ssh/config
file for the VSO host did the trick.