I need some help trying to figure out how to restrict the reading and writing access of usb devices. There are two groups on my system:
- usbreaders: only should have rights to access and read the usb content.
- usbwriters: should have reading and writing rights on the usb content.
I configured the following udev rule to create a symbolic link of the storage device attached:
Then I configured autofs to mount the usb content with different permissions to two different folders:
MY_USB -fstype=auto :/dev/USB_MASS_STORAGE1
/USBRO /etc/auto.master.d/auto-USB.autofs --timeout=10,noexec,nosuid,uid=root,gid=usbreaders,fmask=127,dmask=027 /USBRW /etc/auto.master.d/auto-USB.autofs --timeout=10,noexec,nosuid,uid=root,gid=usbwriters,fmask=007,dmask=007 +auto.master
But something weird happens. Permissions changes automatically, sometimes owns to usbwriters and sometimes to usbreaders o both folders... really weird.
Could anybody give me ha hand with this? Thank you, really aprecciated!