I try to list the contents of my sdcard using kdeconnect. As I understand it, this is done using an ssh connection (sshfs). When I try to list the contents of the sd card on my computer, e.g.

ls /run/user/1000/aa321541a9e62340/storage/xxxx-xxxx

I get an Operation not permitted, but listing the contents of any subfolder e.g. /run/user/1000/aa321541a9e62340/storage/xxxx-xxxx/Music works without problems. Now I read that this is most likely due to an android permissions problem (Can't show the content of /sdcard of my Android phone from Ubuntu's Nautilus or FileZilla via sftp).

On android, the permissions of /storage/xxxx-xxxx show as

 drwxrwx--x root everybody

When I do chmod o+r /storage/xxxx-xxxx as root this seems to be ignored.

Can someone tell me what I can do in order to be able to list the contents of my sd card over ssh?

  • What ssh daemon you are running on Android phone? Termux or some standalone binary? You can run sshd in debug mode to see what happens when you try to list the contents on PC. – Irfan Latif Sep 26 '18 at 7:48
  • The code for kdeconnect says "implementation 'org.apache.sshd:sshd-core:0.8.0'". Unfortunately I have no idea how to run that in debug mode. – lineinthesand Sep 27 '18 at 19:19
  • I misunderstood that. You are running kdeconnect app on Android. That has buultin sshd which is harder to troubleshoot. Instead install Termux app on Android and then install package openssh. Start sshd with -d option to get debug messages. Now mount sshfs on PC and browse sd card. Errors will be printed on Termux. Please note that Termux needs Storage permission to access SD card. You can try enabling same permission for KDEConnect as well. – Irfan Latif Sep 28 '18 at 1:46
  • I tried your suggestion. Problem is: there is no problem, i.e. mounting via sshfs works, as does listing the content of the SD card root. Could the sshd version kdeconnect is using be the culprit? – lineinthesand Sep 29 '18 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.