When I want to use git on with azure devops (vsts) I can't use git clone, pull, push etc. I get the error:
remote: remote: Your Git command did not succeed. remote: Details: remote: Public key authentication failed. remote: fatal: Could not read from remote repository.
But when I use the command below it works, so the problem is not the key.
ssh-agent sh -c 'ssh-add ~/.ssh/key; git push repo'
When I do a git clone, push, pull etc I thought it goes through your .ssh dir to automatically check which key to use. Anybody any idea on how to fix this?
It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it. Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.
My case was more tricky. VisualStudio.com banned my old ssh key and didn't bother to somehow notify me. Experimentally I figured out that I just need to add a new key and use it instead.
ssh-keygen -f ~/.ssh/new_key
In ~/.ssh/config:
Host vs-ssh.visualstudio.com
IdentityFile ~/.ssh/new_key
That worked.
Then fun thing was that they don't let you remove the old banned key from SSH Keys
page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With