jj icon indicating copy to clipboard operation
jj copied to clipboard

jj git clone doesn't support interactive authentication

Open zygoloid opened this issue 3 years ago • 1 comments

Description

jj git clone (and presumably other jj git commands) don't support interactive authentication, for example if ssh is used to connect to the remote and the ssh key has a passphrase.

Steps to Reproduce the Problem

  1. Set up a github ssh key with a passphrase, and specify a corresponding IdentityFile in .ssh/config
  2. Attempt to jj git clone git@github:...

Expected Behavior

The passphrase for the ssh identity file is requested, and the git operation continues.

Actual Behavior

jj git clone fails with the error:

Error: Fetch failed: Failed to retrieve list of SSH authentication methods: Failed getting response; class=Ssh (23); code=Auth (-16)

Specifications

  • Platform: linux
  • Version:

zygoloid avatar Jun 29 '22 20:06 zygoloid

This is a known limitation. I recommend using ssh-agent until it's fixed (and also after it's fixed).

martinvonz avatar Jun 30 '22 05:06 martinvonz

I think (I've since gone back to Git) that this means jj doesn't currently work with 1Password's SSH agent or at least I was unable to continue when using it. Just wanted to add this to the issue in case others wander by looking.

worldofgeese avatar Sep 20 '23 11:09 worldofgeese

Even if ssh-agent is running it seems to give cryptic errors if the agent doesn't have the key added yet: Error: Failed to authenticate SSH session: Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format; class=Ssh (23)

Seems like the error message could at least be improved for that case, but that probably comes directly from libgit2, right?

dbarnett avatar Mar 19 '24 19:03 dbarnett