No sftp connection to Ubuntu 22.04

After upgrading to Jammy Jellyfish I could no longer connect from my phone using AndFTP (sftp).

AndFTP gave the error message:

CONNECT myhost
There was a problem while connecting to myhost:22
java.io.IOexception: Key exchange was not finished, connection is closed.

The reason for this error is that RSA keys are now deprecated and disabled by default in Ubuntu’s sshd config. The problem can be solved by changing the host definitions in AndFTP:

Alternatively, the sshd configuration can be changed to re-enable rsa keys (this, however, is sub-optimal for security):

cat << EOF > /etc/ssh/sshd_config.d/allow_rsa_keys.conf
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
EOF

systemctl restart sshd

Also see:

Leave a Reply

Your email address will not be published. Required fields are marked *