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

Error: ssh: handshake failed: knownhosts: key mismatch #619

Closed
jarbus opened this issue Nov 25, 2022 · 6 comments
Closed

Error: ssh: handshake failed: knownhosts: key mismatch #619

jarbus opened this issue Nov 25, 2022 · 6 comments

Comments

@jarbus
Copy link

jarbus commented Nov 25, 2022

Using git-bug, getting this error when I try to push to remote:

➜ git bug push
Error: ssh: handshake failed: knownhosts: key mismatch

Reported it here: MichaelMure/git-bug#929. Dev said it might be a problem with go-git. I can push and pull with regular git, so I'm wondering if git has an ssh configuration that go-git doesn't support.

@farhaven
Copy link

See #516 for a workaround for this.

@pjbgf
Copy link
Member

pjbgf commented Nov 25, 2022

That sounds like an issue with the picked algorithm used during the SSH handshake. That should be fixed via #411.

Are you using the latest version of go-git? If you do, do may have entries in your known_hosts that are not aligned with the key you are providing.

@MichaelMure
Copy link
Contributor

MichaelMure commented Nov 25, 2022

Are you using the latest version of go-git? If you do, do may have entries in your known_hosts that are not aligned with the key you are providing.

If I'm not mistaken, that fix has not been released in a tagged version yet. git-bug currently use the latest v5.4.2.

@pjbgf
Copy link
Member

pjbgf commented Nov 25, 2022

@MichaelMure you may update to the latest version from master with:

go get github.com/go-git/go-git/v5@master

@jarbus
Copy link
Author

jarbus commented Nov 27, 2022

@pjbgf I'm still facing this issue after running this command and recompiling

@jarbus
Copy link
Author

jarbus commented Nov 30, 2022

This issue has since been solved by adding my id_rsa key to ssh-agent, which I didn't do initially because I was using a different key with github

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

4 participants