Open stacyharper opened 2 weeks ago
$ git push origin master Enter passphrase for key '/home/stacy/.ssh/id_rsa':
Looking at the log of the successfull git push, it looks like the SSH key is an rsa
ssh key.
The last time I ran into something like this, that turned out to be the problem and the error message and hint were both wrong.
Would it be possible for you to try out an ed25519
key, just to rule that out? They can be created with $ ssh-keygen -t ed25519
.
if that doesn't work, I'll see if I can try to repro this locally.
Hmmmm, I found a similar problem with cargo-generate
[1]. It seems the problem is because the private key file was passwd protected. Maybe you could try with a non-passwd protected file or use ssh-agent
[2]. jj
can work with keys loaded into the agent.
If that turns out to be the problem, we can probably add another hint.
[1] - https://github.com/cargo-generate/cargo-generate/issues/470 [2] - https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent
The fetch works after the initial unlock from vanilla git:
$ jj git fetch
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)
Hint: Jujutsu uses libssh2, which doesn't respect ~/.ssh/config. Does `ssh -F /dev/null` to the host work?
$ git fetch
Enter passphrase for key '/home/stacy/.ssh/id_rsa':
$ jj git fetch
Nothing changed.
So I guess the problem come with the passphrase.
As a workaround you can use either use password less ssh certs or use ssh-add
to add the keys to ssh-agent, then jj
will work well with keys in the agent.
For a workaround, I guess we could add a hint about passwd protected private key files as well.
For long term fix, we should probably optionally collect and pass in the passphrase, but I don't know a good way to detect if an ssh private key file is passwd protected, so this can be a pain.
@martinvonz @yuja may have ideas for a long term fix.
https://github.com/martinvonz/jj/pull/3191 might help if ssh
command tries hard to obtain tty.
Description
I'm not sure what I did wrong here. But I also encountered this on another machine. So maybe something is wrong?
The repo here is hosted on git.sr.ht. Also, I note that I am not asked for my ssh passphrase, while
ssh -F /dev/null git@git.sr.ht
does.Remotes are:
Steps to Reproduce the Problem
Expected Behavior
It pushs correctly
Actual Behavior
It fails with this error
Specifications
Complementary
I can git push, a vanilla way: