2

I just installed Ubuntu 22.04 on my desktop computer and now the Android app AndFTP on my phone gives the error

There was a problem while connecting to 192.168.178.52:22 java.IOException Key exchange was not finished, connection is closed.

when I try to login using SSH with a keypair, even before I entered the password of the keypair.

When I try ssh user@192.168.178.52 on the desktop itself it works just fine.

What am I doing wrong?

Adriaan
  • 650

1 Answers1

5

It seems to me that 22.04 has reviewed a lot of security and enforced a lot of changes to the previous defaults. From what I can tell, ED25519 is deemed to be significantly better than RSA, which has been disabled by default.

If you uncomment "HostKey /etc/ssh/ssh_host_ed25519_key" in /etc/ssh/sshd_config and restart the server with "sudo service sshd restart". You can now connect this way without enabling the "lesser" RSA method.

In AndFTP, you can go to "Edit connection" > "Advanced" > "Expert/Specific FTP settings" > "SSH provider" and switch to the "Secure" mode, which works for me.

  • There's extra steps if using key authentication: Advanced->SSH key. Copy and rename the ed25519 private key (e.g id_ed25519) to be named like an image file, e.g id_ed25519.png

    This is needed apparently because of the way Android grants the app file access. The AndFTP developer themselves suggested this in a response to someone's review on the Play Store

    – happyskeptic Mar 01 '23 at 06:53