1

I set up a Ubuntu 14.04 machine for my family.

I noticed that when I insert a USB key it gets automounted to /media/$username/$volumename. /media/$username has an ACL that only allows $username to access the medium, causing problems when switching users. The new user has no rights whatsoever, so the only options are pulling out the USB key and re-inserting it.

Googling, I found this: https://askubuntu.com/a/276670. Using this udev rule I managed to tell udisks2 to automount media to /media/$volumename. Still /media/$volumename has permissions set to 700, causing the same problems.

I suspect that udisks2 uses a restrictive umask for automounts. Does anyone know how to change the umask? Is there a possibility to set the group of the mount directory (so that I could use 770 permissions)?

/etc/fstab is not a solution, since this has to work for automounts of unknown media.

dlrlc
  • 111
  • 2
  • is there a reason not to use chmod / chown? – Tim Oct 19 '15 at 15:24
  • It’s not possible to change permissions on a FAT filesystem, they have to be set when mounting. – dlrlc Oct 19 '15 at 15:28
  • Of /media I mean – Tim Oct 19 '15 at 15:28
  • $volumename still will be 700. – dlrlc Oct 19 '15 at 15:29
  • Luc, can you reformat your USB flash memory as ext3 or ext4 ? This would make things very much easier as you could then give it a tag (can be done with FAT32 as well) and more importantly use sudo chmod 770 on it. Just an idea ... – Cbhihe Oct 19 '15 at 15:47
  • You should be able to adjust the MODE in the udev rule. umask 007 should be equivalent to 770. – earthmeLon Oct 19 '15 at 20:11
  • 1
    @Cbhihe I can’t reformat anything, since this is supposed to work with USB keys from other people, too. – dlrlc Oct 21 '15 at 18:03
  • @earthmeLon I cannot check currently, but I think this will only change the permissions of the /dev/* file? The following link makes me believe that mount masks are hardcoded into udisks2 :-( http://ubuntuforums.org/showthread.php?t=1606193 – dlrlc Oct 21 '15 at 18:05
  • Yes, MODE=---- only sets "permissions for the device node. Every specified value overrides the compiled-in default value." – Cbhihe Oct 21 '15 at 18:55

0 Answers0