Does it actually work when you try to access via Dropbear:
dbclient dietpi-survey@ssh.dietpi.com
# then enter
upload2dietpi
It will ask you to accept the host key, since Dropbear supports the modern Ed25519 key format while libssh2 (used by curl) supports only RSA. After entering the password it will exit immediately as only SFTP is supported:
This service allows sftp connections only.
But if you get so far, at least we know that generally SSH communication and authentication from you system works, so it then must be something about curl/libssh2.
Can you also show the output of these commands:
echo $G_HW_MODEL_NAME
uname -a
apt policy curl libssh2-1
Warning: Permanently added the RSA host key for IP address '2a06:1c40:3::142' to the list of known hosts.
dietpi-survey@ssh.dietpi.com's password:
Connected to ssh.dietpi.com.
Strange, there was another report about this SSH layer error and we couldn’t find any reason or solution for it. I’m puzzled since it works for everyone else and the package/build of all underlying libraries and commands are the same.
Not sure whether the known_hosts entry autogenerated like that may cause the issue. Generally our images ship with our host key added, here how to recreate it: https://github.com/MichaIng/DietPi/issues/5137#issuecomment-1006110606
If you have other known hosts in that file, please add the line manually as the given command was to recreate the file, which was missing competely for that user.
Wow… I renamed the existing known_hosts file and created a new one with your command and suddenly sending the survey data works… Well, thanks for your help!
Wow, I’m somehow surprised as well. The error message was so absolutely not pointing into that direction, also the output Found host ssh.dietpi.com in /root/.ssh/known_hosts looks like it is all fine.
Only now I see that Set “ecdsa-sha2-nistp256” as SSH hostkey type actually refers to a wrong host key type, since the stored one is an RSA host key. On a successful upload it shows hence Set “ssh-rsa” as SSH hostkey type. Still, I’d have expected an error message then that the SSH host key retrieved from the server does not match known host key .
However, great that it finally works now. Looks like we need to keep in mind the known_hosts recreation as a generic solution for survey issues .