cargo-generate: cargo generate using ssh results in: Git Error: Failed to authenticate SSH session: ; class=Ssh (23)

Hello! I’m currently struggling getting this tool to work properly with ssh. Generating from github using https works fine. I have no issues using git by itselve, but for some obscure reason cargo generate does not play nicely with it. Here is the error I am presented with after trying to clone a simple template of mine:

cargo generate git@github.com:VirtualNonsense/rust_bluepill_minimal_template.git
 Using application config: C:\Users\VirtualNonsense\.cargo\cargo-generate.toml
 Using ssh-identity from application config: $HOME/.ssh/id_rsa
 Favorite git@github.com:VirtualNonsense/rust_bluepill_minimal_template.git not found in config, using it as a git repo url
 Using private key: `%userprofile%\.ssh\id_rsa` for git-ssh checkout
Error:  Git Error: Failed to authenticate SSH session: ; class=Ssh (23)

I’ve seen that there seems to be an issue with passphrase protected keys so I made sure mine does not have one. I also tied an ed25519 key but it did not change the result as well. I feel like I’m missing something obvious and would appreciate some guidance😅

My system: Win11: Version 21H2 rust: rustup 1.24.3 cargo 1.61.0 rustc 1.61.0 cargo-generate 0.14.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to reproduce the issue on my win11 box. It’s still present in v0.15.0.

Working on a fix.

I copied a key (ed25519) that is working under WSL and moved it in my windows .ssh directory. Unfortunately it yields the same result:

Error: Please check if the Git user / repository exists.

Caused by:
    Failed to authenticate SSH session: ; class=Ssh (23)