Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

tl;dr:

How do I make gnome automount USB devices with permissions so that everyone in the group can access them instead of just one user that is logged in at the time the USB storage is plugged in?

(Here the group is called "confus" and the users "narur" and "confus" are both in that group. Only narur was logged in, at time of USB plug in so only narur can access the USB device - even after a sudo chmod g+rw. How do I change that?)


Details:

I run a media server at my home. It is connected to a projector as only monitor. Form time to time I like to plug in a USB drive to copy stuff from the server to said drive. The drive gets auto-mounted by the usual gnome shenanigans. Obviously I don't want to turn on the projector (take a while and is not good on the lamp). So I login to the server over ssh and do the copy over terminal from another PC.

Problem is, the USB drive gets mounted under a different user than the user I log in as via ssh. My ssh user doesn't have the rights to open the mount point chosen by gnome although it is in the same group. For clarification see this terminal session:

confus@conserve:/media$ id
uid=1000(confus) gid=1000(confus) groups=4(adm),8(mail),20(dialout),24(cdrom),46(plugdev),113(lpadmin),114(sambashare),122(admin),126(debian-transmission),135(debian-tor),1000(confus)

confus@conserve:/media$ ll
total 28
lrwxrwxrwx  1 root   root      6 Mar  8  2009 cdrom -> cdrom0
drwx------  1 narur  confus 4096 Oct  8 16:53 contemplate     # <-- USB drive
drwxr-xr-x  2 root   root   4096 May  3  2010 iso
drwxr-xr-x  2 confus confus 4096 Dec  8  2009 usb1

confus@conserve:/media$ sudo chmod -R ug+rwX 4009-D44F/       # <-- Doesn't do anything
[sudo] password for confus: 

confus@conserve:/media$ ll
total 28
lrwxrwxrwx  1 root   root      6 Mar  8  2009 cdrom -> cdrom0
drwx------  1 narur  confus 4096 Oct  8 16:53 contemplate    # <-- No change after chmod
drwxr-xr-x  2 root   root   4096 May  3  2010 iso
drwxr-xr-x  2 confus confus 4096 Dec  8  2009 usb1

My ssh user is "confus" while the disk is mounted for the user "narur". Obviously a simple chmod doesn't do since its a mount point. The problem exists for every USB storage device.

I know I could write a udev rule and I know that device based solutions exists. But there should be an easier solution to this problem, that's native to gvfs.

Update:

Nothing has changed since 2009. This is embarrassing. There should be an easy work around for this problem at least.

share|improve this question
    
It's not the full answer, but you're looking for autofs. There's a decent manual/descritpion here: wiki.debian.org/AutoFs . The GID mount option is what you're looking for. –  hbdgaf Oct 25 '12 at 13:32
    
If I'm not mistaking that's also a by-device solution, isn't it? One has to configure each individual device. I want my solution to apply to all auto mounted drives since various owners might want to copy files on their respective drives. –  con-f-use Oct 25 '12 at 13:52
    
Usually it would be by device. You could use fuzzy udev rules to run mount scripts if you want it to be generic. –  hbdgaf Oct 25 '12 at 13:55
    
So no need for autofs then... ;-) I'd still prefer a solution inherent to gvfs or gnome. There seem to be quiet a lot bug reports on this but nothing changes since 2009 –  con-f-use Oct 25 '12 at 14:01
    
I'ld make the fuzzy udev rule run a script to add it to autofs mountpoints then unmount and remount it going around the problem instead of through it. –  hbdgaf Oct 25 '12 at 14:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.