5

I'm using Moto G4 play with Marshmallow; and CentOS 7. I'm able to mount the device and see the content as root, by using jmtpfs. First time I used sudo then I switched as root and then mounted, works fine on both occasions; but files are only visible for root user. personal user is not able to access the content

[shiva@jayan ~]$ sudo su -
[sudo] password for shiva: 
Last login: Wed Dec  6 23:51:54 IST 2017 on pts/0
[root@jayan ~]# jmtpfs /media/phone/
Device 0 (VID=22b8 and PID=2e82) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Android device detected, assigning default bug flags
[root@jayan ~]# ll /media/phone/
total 0
drwxr-xr-x. 38 root root 0 Dec  3  4453203 Internal storage

But when I try to view it as my user, I get permission denied, as a dumb attempt I even tried to change user after mounting.

[shiva@jayan /]$ ll /media/phone 
ls: cannot access /media/phone: Permission denied
[shiva@jayan /]$ cd media/
[shiva@jayan media]$ ll
ls: cannot access phone: Permission denied
total 0
d????????? ? ? ? ?            ? phone
[shiva@jayan media]$ sudo chown shiva:shiva phone 
[sudo] password for shiva: 
chown: changing ownership of ‘phone’: Function not implemented

Then I tried to mount from my user, it detected no mtp :(

[root@jayan ~]# fusermount -u /media/phone
[root@jayan ~]# exit
logout
[shiva@jayan ~]$ jmtpfs /media/phone/
No mtp devices found.

Now my question is how to resolve this? How to make mtp devices available for my user (or) How to access files after mounting it as root! I tried using sudo chmod -R 775, it ran forever :'( yet was not able to access those files

4
  • First what group owns that mount when it's mounted? Then you need to realize that there is a udev rule that determine what happens to that mount, so overriding that might do the trick! Dec 19, 2017 at 5:15
  • Please run this cat /etc/group | grep uucp, if that group exists add yourself to it! And see here: wiki.archlinux.org/index.php/MTP Dec 19, 2017 at 5:22
  • 1
    Your question told me that jmtpfs exists, and it turned out it works out just fine with my Android phone - thanks!
    – telcoM
    Dec 21, 2017 at 13:32
  • @GeorgeUdosen nope there is no such group, thanks for the input; might help someone with such case :)
    – Shiva
    Dec 21, 2017 at 17:54

1 Answer 1

3
+50

Un-comment the user_allow_other on your /etc/fuse.conf file.

Mount your android device with allow_other option on your home directory without sudo :

$ mkdir phone
$ jmtpfs -o allow_other phone/
2
  • Thanks for the answer, not in a position to check and certify the answer. But I felt compelled to thank, and so here it is :) give me 6 hours
    – Shiva
    Dec 21, 2017 at 11:56
  • 1
    Thanks!! Works like magic. Didn't do any hard core file transfer testing - sort of one mkdir, delete tmp file and open a video. Hope that covered all normal file operations ;)
    – Shiva
    Dec 21, 2017 at 17:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .