Bug 351725

Summary: Cannot Browse SFTP
Product: [Applications] kdeconnect Reporter: dean.birch0
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED FIXED    
Severity: normal CC: digifun, francexi, HSSCubus, laurent.rineau, phobosk
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: output.log contains kdeconnectd output when reproducing

Description dean.birch0 2015-08-24 21:18:36 UTC
Created attachment 94207 [details]
output.log contains kdeconnectd output when reproducing

I have been unable to browse my phone files in dolphin via the SFTP plugin of KdeConnect, but only have recently found a way of getting out some logs.

kdeconnect-kde version: c8e0c47 Fixed crash
kdeconnect-android version: (Play store version as of 2015/08/24, can't see where to find the version)

Steps taken to reproduce: I ran kdeconnectd manually, opened dolphin, and clicked my phone name, then "All files", and outputted the stdout/stderr of kdeconnectd to output.log (attached).

In dolphin, I had the error: "The file or folder /home/dean/.config/kdeconnect/f8531db496ecc9e7/kdeconnect_sftp/f8531db496ecc9e7/storage/emulated/0 does not exist."

The path "/storage/emulated/0/" does exist on my android phone (Nexus 5, Android version 5.1.1).

They key issue (no pun intended) looks to be: "Unable to negotiate with 172.16.0.64: no matching host key type found. Their offer: ssh-dss\r\n". It looks like the SFTP server running on Android expects ssh-dss keys rather than RSA keys? I've tried clearing application data on the android app, in case an old (now invalid) key type was remaining, but no luck.

This line also suspicious: "QDBusAbstractAdaptor: Cannot relay signal SftpPlugin::packageReceived(NetworkPackage): Unregistered input type in parameter list: NetworkPackage".

I'm happy to answer any questions, or try some other steps or workarounds.
Comment 1 dean.birch0 2015-08-24 21:31:04 UTC
Just read an announcement here:
https://www.archlinux.org/news/openssh-70p1-deprecates-ssh-dss-keys/

And then read a way to re-enable ssh-dss keys here:
http://www.openssh.com/legacy.html

Solution was to add the following into ~/.ssh/config:

Host 172.16.0.64
   HostKeyAlgorithms ssh-dss
Comment 2 Albert Vaca Cintora 2015-08-25 04:30:10 UTC
Thanks for reporting the bug and figuring out the root cause, that was really helpful!

I will patch the desktop code so you don't have to add that line to your ssh config, and also have a look at the Android side to see if we can use a better algorithm.

Many thanks again!
Comment 3 Albert Vaca Cintora 2015-08-25 04:30:42 UTC
Git commit bc3fb512d407a5ad19d0fc2c16a8379c81afcf47 by Albert Vaca.
Committed on 25/08/2015 at 04:27.
Pushed by albertvaka into branch 'master'.

Fixed incompatibility with OpenSSH 7.0

M  +5    -4    plugins/sftp/mounter.cpp

http://commits.kde.org/kdeconnect-kde/bc3fb512d407a5ad19d0fc2c16a8379c81afcf47
Comment 4 Albert Vaca Cintora 2015-11-12 01:00:51 UTC
*** Bug 345776 has been marked as a duplicate of this bug. ***
Comment 5 Albert Vaca Cintora 2015-11-12 14:54:01 UTC
*** Bug 353919 has been marked as a duplicate of this bug. ***
Comment 6 Cubus 2016-09-04 19:37:36 UTC
I still have this problem. I use the rpm provided from the KDE:Extra opensuse leap 42.1 repo.
it's on version 0.9g.
Comment 7 PhobosK 2021-10-03 18:38:39 UTC
At the moment the Android part of the application (Kdeconnect Beta v. 1.17.0 of 6th May 2021) offers only **ssh-rsa** as HostKeyAlgorithms, and thus the SFTP plugin of the KDE application stopped working again.
The error:
Unable to negotiate with XXX.XXX.XXX.XXX: no matching host key type found. Their offer: ssh-rsa\r\n".

So the applied before patch should be reverted back. When this is done all works correctly.

See the thread at the source code:
https://invent.kde.org/network/kdeconnect-kde/-/commit/9bfa255a60b25c0976ec6062e2252eb67b24dca5#note_314823

Thanks
Comment 8 PhobosK 2021-10-03 18:53:49 UTC
Sorry for the kind of flood, but forgot to say that this is valid for OpenSSH 8.8_p1 where ssh-rsa has to be explicitly enabled as config option - OpenSSH release 8.8 at https://www.openssh.com/txt/release-8.8
Comment 9 Antonio Rojas 2021-10-03 19:28:00 UTC
(In reply to PhobosK from comment #8)
> Sorry for the kind of flood, but forgot to say that this is valid for
> OpenSSH 8.8_p1 where ssh-rsa has to be explicitly enabled as config option -
> OpenSSH release 8.8 at https://www.openssh.com/txt/release-8.8

That's tracked in bug 443155