1

On Debian, when automounted, all files and directories in USB drives have 777 permissions. I don't like it very much. I know a bit of udev rules, and I think I could write a rule of mine to override the default behaviour. But I also would like to know which system rules are involved in this mechanism, can you help me?

Thanks in advance.

3
  • I would have though you would be making an entry in /etc/fstab for this? Commented Apr 23, 2018 at 14:34
  • fstab it's not smart enough. There's already a subsystem which manages device hot plugging, it only needs to be tweaked a bit.
    – Daniele
    Commented Apr 23, 2018 at 15:18
  • First step is to find out which package you have installed that does the automounting. For example, usbmount allows you to specify permissions and owner/group of mounted FAT filesystems in the configuration, IIRC. And yes, it uses udev rules, so you don't have to write those yourself.
    – dirkt
    Commented Apr 23, 2018 at 16:13

1 Answer 1

0

From the documentation I am seeing, you can add this to /etc/udev/rules.d/openauto.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="*", ATTR{idProduct}=="*", MODE="0660", GROUP="plugdev"

Naturally, set the MODE and GROUP to your desired permission set and group-owner for your system.

You must log in to answer this question.

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