Can't access phone filesystem with KDE Connect

Bug #1872075 reported by Jan Rathmann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE Connect - Desktop (Linux)
Fix Released
Medium
kdeconnect (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Hello,

if I try to use KDE Connect on Kubuntu Focal, I can't access the phone's filesystem anymore.

If I click on the phone icon in Dolphin, I get the following error message:

"Error when accessing filesystem. sshfs finished with exit code 1."
(see also attached screenshot)

This happens the same way on two different phones (BQ Aquaris X, Google Nexus 4), both phones have KDE Connect 1.13.7 from F-Droid repository installed.

What I've tried to fix this:

- Unpair/Pair the phone
- Deleting ~/.config/kdeconnect
- Test in a different, pristine installation of Kubuntu Focal

Neither of that helped.

Before Focal I used Kubuntu Eoan with Kubuntu Backports PPA enabled. On Eoan, I could access the filesystems of both phones without any problem, so this seems to be somehow related to a change in Focal.

Kind regards,
Jan

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: kdeconnect 1.4-0ubuntu4
ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
Uname: Linux 5.4.0-21-generic x86_64
ApportVersion: 2.20.11-0ubuntu24
Architecture: amd64
CurrentDesktop: KDE
Date: Fri Apr 10 15:05:09 2020
InstallationDate: Installed on 2020-04-08 (2 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Beta amd64 (20200408)
SourcePackage: kdeconnect
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Davidpape1995 (davidpape1995) wrote :

SUMMARY

The Android app offers ssh key exchange using diffie-hellman-group14-sha1 and diffie-hellman-group1-sha1. In the newest version of openssh the former was removed from the defaults, the latter has been disabled for a while. This results in kdeconnect not being able to create a connection using sshfs.

STEPS TO REPRODUCE
1. Click on your phone icon in dolphin

OBSERVED RESULT
Error message

EXPECTED RESULT
A connection to the phones file system

SOFTWARE/OS VERSIONS
App on Android version 1.13.7
kdeconnect 1.4.1 on Linux

ADDITIONAL INFORMATION

kdeconnectd[1119]: kdeconnect.plugin.sftp: Mount device: "XXX"
kdeconnectd[1119]: kdeconnect.plugin.sftp: Created mounter
kdeconnectd[1119]: kdeconnect.plugin.sftp: Starting loop to wait for mount
kdeconnectd[1119]: kdeconnect.plugin.sftp: Mount device: "XXX"
kdeconnectd[1119]: kdeconnect.plugin.sftp: Unmount QObject(0x0)
kdeconnectd[1119]: kdeconnect.core: Converting IPv6 QHostAddress("::ffff:192.168.178.29") to IPv4 QHostAddress("192.168.178.29")
kdeconnectd[1119]: kdeconnect.plugin.sftp: Starting process: "sshfs kdeconnect@192.168.178.29:/ /run/user/1000/719fb2d6a31cfd4d -p 1739 -s -f -F /dev/null -o IdentityFile=/home/XXX/.config/kdeconnect/privateKey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss -o uid=1000 -o gid=1000 -o reconnect -o ServerAliveInterval=30 -o password_stdin"
kdeconnectd[1119]: QDBusAbstractAdaptor: Cannot relay signal SftpPlugin::packetReceived(NetworkPacket): Unregistered input type in parameter list: NetworkPacket
kdeconnectd[1119]: kdeconnect.plugin.sftp: Process started
kdeconnectd[1119]: kdeconnect.plugin.sftp: "XXX" "Remote filesystem mounted at /run/user/1000/719fb2d6a31cfd4d"
kernel: fuse: init (API version 7.31)
kernel: *** VALIDATE fuse ***
kernel: *** VALIDATE fuse ***
systemd[1]: Mounting FUSE Control File System...
systemd[1]: Mounted FUSE Control File System.
kdeconnectd[1119]: kdeconnect.plugin.sftp: stdout: "Unable to negotiate with 192.168.178.29 port 1739: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\n"
kdeconnectd[1119]: kdeconnect.plugin.sftp: stdout: "read: Connection reset by peer\n"
kdeconnectd[1119]: kdeconnect.plugin.sftp: Process failed (exit code: 1 )
kdeconnectd[1119]: kdeconnect.plugin.sftp: Unmount KProcess(0x55837cbda9d0)
systemd[975]: run-user-1000-719fb2d6a31cfd4d.mount: Succeeded.
systemd[1]: run-user-1000-719fb2d6a31cfd4d.mount: Succeeded.
kdeconnectd[1119]: kdeconnect.plugin.sftp: Destroy mounter
kdeconnectd[1119]: kdeconnect.plugin.sftp: Unmount QObject(0x0)

Revision history for this message
In , Maciej-stanczew+b (maciej-stanczew+b) wrote :

Regarding workarounds: since the call to sshfs uses "-F /dev/null", config file for SSH (~/.ssh/config) cannot be used to enable diffie-hellman-group14-sha1.
The only workaround I've found is to create a script called "sshfs", with the following content:
  exec /usr/bin/sshfs -oKexAlgorithms=+diffie-hellman-group14-sha1 "$@"
and put it in PATH (before /usr/bin), so that KDE Connect will use it when calling sshfs. After this, I can successfully browse my phone using Dolphin.
(Tested on Arch; sshfs binary may be in a different place in other distributions, and then path in the script would need to be changed.)

Revision history for this message
In , Davidpape1995 (davidpape1995) wrote :

Has been fixed by adding a key exchange option in the desktop application.

Revision history for this message
In , 2wxsy58236r3 (2wxsy58236r3) wrote :

> Has been fixed by adding a key exchange option in the desktop application.
Could you please give me the URL to the Git commit so that I can try it out? Thank you.

Revision history for this message
In , Davidpape1995 (davidpape1995) wrote :

Oups, I missread the version number. It was the Arch packager who fixed it. The bug should still be there in the repository https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/kdeconnect&id=3f4cabc50dab5ea4ca613c4e48808912e4e5fb71

Revision history for this message
In , Dennis Schridde (devurandom) wrote :

(In reply to David from comment #2)
> Has been fixed by adding a key exchange option in the desktop application.

Shouldn't this be fixed by fixing the Android app to no longer use deprecated hash algorithms?

Revision history for this message
In , LKV (likivik) wrote :

Can confirm

SOFTWARE/OS VERSIONS
App on Android 9 and Android 10 version 1.13.7
kdeconnect 1.3.5 on Linux

ADDITIONAL INFORMATION
`sudo journalctl --since "1 hour ago" -o cat | grep kdeconnect`:

kdeconnect.plugin.sftp: Mount device: "ONEPLUS"
kdeconnect.plugin.sftp: Created mounter
kdeconnect.plugin.sftp: Starting loop to wait for mount
kdeconnect.kio: Stat: QUrl("kdeconnect://77ac0c62ffef87e5/")
kdeconnect.plugin.sftp: Mount device: "ONEPLUS"
kdeconnect.plugin.sftp: Unmount QObject(0x0)
kdeconnect.core: Converting IPv6 QHostAddress("::ffff:10.10.10.224") to IPv4 QHostAddress("10.10.10.224")
kdeconnect.plugin.sftp: Starting process: "sshfs kdeconnect@10.10.10.224:/ /run/user/1001/77ac0c62ffef87e5 -p 1744 -s -f -F /dev/null -o IdentityFile=/home/likivik/.config/kdeconnect/privateKey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss -o uid=1001 -o gid=100 -o reconnect -o ServerAliveInterval=30 -o password_stdin"
kdeconnect.plugin.sftp: Process started
kdeconnect.plugin.sftp: "ONEPLUS" "Remote filesystem mounted at /run/user/1001/77ac0c62ffef87e5"
kdeconnect.plugin.sftp: stdout: "Unable to negotiate with 10.10.10.224 port 1744: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\n"
kdeconnect.plugin.sftp: stdout: "read: Connection reset by peer\n"
kdeconnect.plugin.sftp: Process failed (exit code: 1 )
kdeconnect.plugin.sftp: Unmount KProcess(0x15ae280)
kdeconnect.plugin.sftp: Destroy mounter
kdeconnect.plugin.sftp: Unmount QObject(0x0)

Revision history for this message
In , poloking (poloking) wrote :

I started an "issue" in the GitLab, here: https://invent.kde.org/kde/kdeconnect-android/-/issues/19

I see that solution could work (Though I can't get it to). Would an alternative solution be to compile sshfs with the patch from here?:
https://git.archlinux.org/svntogit/community.git/tree/trunk/kdeconnect-openssh-8.2.patch?id=3f4cabc50dab5ea4ca613c4e48808912e4e5fb71

Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :
Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :

I get the following more detailed output from kdeconnectd:

kdeconnect.plugin.sftp: stdout: "Unable to negotiate with 192.168.2.103 port 1747: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\n"
kdeconnect.plugin.sftp: stdout: "read: Connection reset by peer\n"
kdeconnect.plugin.sftp: Process failed (exit code: 1 )

This seems to be the relevant upstream bug report:
https://bugs.kde.org/show_bug.cgi?id=417787

Changed in kdeconnect-desktop:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Rik Mills (rikmills) wrote : Re: [Bug 1872075] Re: Can't access phone filesystem with KDE Connect

On 12/04/2020 09:20, Jan Rathmann wrote:
> I get the following more detailed output from kdeconnectd:
>
> kdeconnect.plugin.sftp: stdout: "Unable to negotiate with 192.168.2.103 port 1747: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\n"
> kdeconnect.plugin.sftp: stdout: "read: Connection reset by peer\n"
> kdeconnect.plugin.sftp: Process failed (exit code: 1 )
>
> This seems to be the relevant upstream bug report:
> https://bugs.kde.org/show_bug.cgi?id=417787

Hi. I have followed that to the archlinux patch that supposedly fixes that.

Could you perhaps try this test build in a PPA which applies that patch?

See: https://launchpad.net/~rikmills/+archive/ubuntu/bug1872075

Thanks

(may well have to restart or log in/out after installing patched kdeconnect)

Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :

Rik, yes the package from your PPA fixes this for me.
Thanks for you quick reaction!

Revision history for this message
Rik Mills (rikmills) wrote :

Fixed for mew as well. Getting a Focal upload in the queue.

Changed in kdeconnect (Ubuntu):
status: New → In Progress
importance: Undecided → High
Rik Mills (rikmills)
Changed in kdeconnect (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdeconnect - 1.4-0ubuntu5

---------------
kdeconnect (1.4-0ubuntu5) focal; urgency=medium

  * Add patch to fix device filesystem browsing with openssh 8.2. Thanks
    to Antonio Rojas from ArchLinux. (LP: #1872075)
    - debian/patches: kdeconnect-openssh-8.2.patch

 -- Rik Mills <email address hidden> Sun, 12 Apr 2020 13:39:05 +0100

Changed in kdeconnect (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
In , Philip Cohn-Cort (cliabhach) wrote :

As per discussion in the Telegram group and on the linked merge request https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/239, this was fixed sometime in 2020. Please make a new bug if you see this appear again.

Changed in kdeconnect-desktop:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.