rust-lang / rust-lang/git2-rs

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

Open
#1,078 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.1k
Forks
450
Avg merge
11m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal reproduction and the two credential-callback paths described: RemoteConnection and Repository.find_remote(...).fetch(...). Compare passworded ssh-agent behavior on Mac and Linux; done means passworded keys from ssh-agent work through ssh_key_from_agent on both platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.