Can't fetch git remote when ssh enabled & known_hosts is a ssh-ed25519 key #344

Open
opened 2021-03-09 18:05:47 +00:00 by noerw · 1 comment
Member

Things like tea pr checkout <idx> fail, when SSH is configured, and known_hosts contains a ssh-ed25519 key:

Error: ssh: handshake failed: knownhosts: key mismatch

That's probably because x/crypto/ssh used by go-git doesn't support ed25519 at all if I remember correctly..

quickfix:

  1. delete the ed25519 key from your known_hosts file (probably ~/.ssh/known_hosts)
  2. ssh into your gitea instance once, requesting & verifying a RSA host key:
    ssh -o HostKeyAlgorithms=ssh-rsa git@yourhost
    

Apart from that, when no host key is present at all, tea fails as well:

Error: ssh: handshake failed: knownhosts: key is unknown

This could be enhanced but isn't much of an issue, as ssh probably was used for that gitea instance before if we enabled ssh during tea login add.

Things like `tea pr checkout <idx>` fail, when SSH is configured, and known_hosts contains a ssh-ed25519 key: ``` Error: ssh: handshake failed: knownhosts: key mismatch ``` That's probably because x/crypto/ssh used by go-git doesn't support ed25519 at all if I remember correctly.. **quickfix**: 1. delete the ed25519 key from your known_hosts file (probably `~/.ssh/known_hosts`) 2. ssh into your gitea instance once, requesting & verifying a RSA host key: ``` ssh -o HostKeyAlgorithms=ssh-rsa git@yourhost ``` --- Apart from that, when no host key is present at all, tea fails as well: ``` Error: ssh: handshake failed: knownhosts: key is unknown ``` This could be enhanced but isn't much of an issue, as ssh probably was used for that gitea instance before if we enabled ssh during `tea login add`.
noerw added the
kind/bug
label 2021-03-09 18:05:47 +00:00
Author
Member

according to 1e61df8d9e this should be supported by x/crypto/ssh. maybe a bug in gogit

according to https://github.com/golang/crypto/commit/1e61df8d9ea476e2e1504cd9a32b40280c7c6c7e this should be supported by x/crypto/ssh. maybe a bug in gogit
noerw changed title from can't do git operations, when ssh enabled & known_hosts contains a ssh-ed25519 key to Can't fetch git remote when ssh enabled & known_hosts is a ssh-ed25519 key 2021-03-12 11:52:48 +00:00
noerw added the
kind/dependency
label 2022-03-09 14:44:44 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#344
No description provided.