git-tools
git-tools copied to clipboard
Failed to authenticate SSH session
Perhaps related to #13 ?, I have an error on try-merge:
Failed to authenticate SSH session: Unable to open public key file; class=Ssh (23)
git and ssh are working fine, peculiarities are:
- non standard ssh port
- ed25519 key
Sorry for the late reply! I got the notifications turned off for some reason. Unfortunately I think this will be hard to reproduce on my own, can you check one of these solutions?
-
It seems I did not put the code to handle passphrase. If you have a passphrase locking your ssh key, this might be the issue. In that case I think it's best that you use
ssh-agentbecause it will unlock the key before adding it to the running agent (I believe). -
The code that handles the credentials is here: https://github.com/cecton/git-tools/blob/72937393b65631cfe97e3b4cd13f6498f60b6dac/src/common.rs#L388-L426
Perhaps you can you check if this looks good to you?
-
I remember I had quite some issues getting this to work properly. Using
git2_credentialswas not enough.I suspect this could be the offending code:
username_from_url.unwrap_or_else(|| user.to_str().unwrap()),If you force it to
userinstead, does it work better?
Hi, thanks, no problem at all!
- the gnome keyring should act as an agent, or at least
gitworks without asking. I'll double check if I still have the same error in a shell I'm sure can see the agent. - I'll have a look there with some
dbg!(). - Can be, my local username is not the remote user, or at least, not on all the servers, maybe
dbg!()will help here too.
I hope to remember to have a look at this in the next few days, if not, feel free to close the issue!