upa / mscp

mscp: transfer files over multiple SSH (SFTP) connections
GNU General Public License v3.0
118 stars 10 forks source link

No match for method server host key algo #13

Closed clay584 closed 4 months ago

clay584 commented 5 months ago

When trying to connect to an embedded device running dropbear sshd, I get a host key algo error.

Here is my ssh config file at ~/.ssh/config

Host satellite-payload1
    HostName 192.168.102.3
    User root
    IdentityFile ~/.ssh/petalinux_dev
    KexAlgorithms +ssh-rsa
    HostKeyAlgorithms +ssh-rsa

Expected behavior:

mscp should respect the ssh config file and use the additional hostkey and kex algorithms and connect.

Actual behavior:

Fails to negotiate ssh algos

mscp -F .ssh/config 100MBfile satellite-payload1:/run/media/mmcblk0p1/
mscp_connect: [ssh.c:185:ssh_init_session] failed to connect ssh server: kex error : no match for method server host key algo: server [ssh-rsa], client [ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256]
upa commented 5 months ago

mscp uses libssh, which parses and applies ssh_config.

+ALGO notation in ssh_config is supported by this commit in libssh, but it is not included in the libssh stable-0.10 branch, which mscp is based on. I'm not sure why the commit hasn't been included, but as a result, +ssh-rsa is not supported at the moment.

Instead, HostKeyAlgorithms ssh-rsa will work as intended.

upa commented 4 months ago

The next release of libssh will include the commit, so a future version of mscp adopting it will (automatically) accept the +ALGO notation.