In some crates, dependencies may be use ssh protocols, cargo build may lead some error like this:
Caused by:
failed to authenticate when downloading repository
attempted ssh-agent authentication, but none of the usernames `git` succeeded
Caused by:
error authenticating: no auth sock variable; class=Ssh (23)
How to fix?
Some advices here like this:
[url "git@github.com:"]
insteadOf = https://github.com/
But not worked for me, I used this resolution:
eval `ssh-agent -s`
ssh-add
cargo ...