Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passworded ssh keys not working with Cred::ssh_key_from_agent on Mac #1078

Open
mbanack opened this issue Aug 19, 2024 · 1 comment
Open

Comments

@mbanack
Copy link

mbanack commented Aug 19, 2024

git2-rs (0.19.0) on Mac does not appear to support using passworded ssh keys from ssh-agent. I haven't yet tested on Linux but I'd like to make something that works on both platforms.

I tested with both RemoteConnection (with credentials callback set using Cred::ssh_key_from_agent) and Repository.find_remote(...).fetch(...) with FetchOptions credentials callback using ssh_key_from_agent. I confirmed that the callback is getting called by adding a panic which does hit when trying to connect or fetch.

Minimal repro published to https://github.com/mbanack/git2-ssh-agent-repro

Is there some other library mechanism that supports passworded keys? It appears that the git command line utilities support this by querying ssh-agent, which I assume is accomplished by the system libgit2.

@mbanack
Copy link
Author

mbanack commented Aug 19, 2024

The error returned is: Error { code: -16, klass: 23, message: "authentication required but no callback set" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant