Ssh_kex2 error using ssh connection

Hello.
I can’t connect via ssh to my gitea server.
If I run:
ssh git@homedatasrv.ru -v
Output:

debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/aleksey/.ssh/id_ed25519 ED25519 SHA256:6Ipfy5oCwGYfdsNOEinla9CYtezWZzTnpsukJOiUfTo agent
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/aleksey/.ssh/id_rsa
debug1: Trying private key: /home/aleksey/.ssh/id_dsa
debug1: Trying private key: /home/aleksey/.ssh/id_ecdsa
debug1: Trying private key: /home/aleksey/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/aleksey/.ssh/id_ed25519_sk
debug1: Trying private key: /home/aleksey/.ssh/id_xmss
debug1: No more authentication methods to try.
git@homedatasrv.ru: Permission denied (publickey).

If I run:
ssh git@homedatasrv.ru -v -o "HostKeyAlgorithms ed25519"
Output:

debug1: Connection established.
debug1: identity file /home/aleksey/.ssh/id_rsa type -1
debug1: identity file /home/aleksey/.ssh/id_rsa-cert type -1
debug1: identity file /home/aleksey/.ssh/id_dsa type -1
debug1: identity file /home/aleksey/.ssh/id_dsa-cert type -1
debug1: identity file /home/aleksey/.ssh/id_ecdsa type -1
debug1: identity file /home/aleksey/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/aleksey/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/aleksey/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/aleksey/.ssh/id_ed25519 type 3
debug1: identity file /home/aleksey/.ssh/id_ed25519-cert type -1
debug1: identity file /home/aleksey/.ssh/id_ed25519_sk type -1
debug1: identity file /home/aleksey/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/aleksey/.ssh/id_xmss type -1
debug1: identity file /home/aleksey/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4
debug1: compat_banner: match: OpenSSH_8.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to homedatasrv.ru:22 as 'git'
ssh_kex2: kex_assemble_namelist: invalid argument

What is the problem with kex2? (I don’t know what is it)
I also tried to add the line to my sshd config:

KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1

I’ve removed the.ssh folder from the Gitea server and recreated it. It has worked. But it didn’t have a problem with access rights 'cos I’ve checked it before removing the folder.
About -o "HostKeyAlgorithms ed25519 - I used the wrong key. There must be ssh-ed25519

1 Like