USB device permissions

julien.fs julien.fs at hotmail.com
Fri May 30 10:33:27 UTC 2008


I had the same problem than you and here is the solution. 

1. with root permissions open the file  
/usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi

in the file find this section :  <!-- allow these mount options for vfat -->

and add this line : <append key="volume.mount.valid_options"
type="strlist">gid=</append>

example :

<!-- allow these mount options for vfat -->
−
<match key="volume.fstype" string="vfat">
−
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
string="Linux">
<append key="volume.mount.valid_options" type="strlist">utf8</append>
<append key="volume.mount.valid_options" type="strlist">shortname=</append>
<append key="volume.mount.valid_options" type="strlist">codepage=</append>
<append key="volume.mount.valid_options" type="strlist">iocharset=</append>
<append key="volume.mount.valid_options" type="strlist">umask=</append>
<append key="volume.mount.valid_options" type="strlist">dmask=</append>
<append key="volume.mount.valid_options" type="strlist">fmask=</append>
<append key="volume.mount.valid_options" type="strlist">uid=</append>
<append key="volume.mount.valid_options" type="strlist">gid=</append>
<append key="volume.mount.valid_options" type="strlist">flush</append>

when it's done save and close. 

2. Now we've patched the file to allow us to setup permissions for a group,
we will set the permissions in question.

- as root open the gconf-editor : simply type gconf-editor

-navigate to : /system/storage/default_options/vfat/mount_options->edit key

for 'uid=' : you'll have to set the id number of the owner. for example
'uid=0' will set root as owner. if you let 'uid=' without id number it's the
logged user who will become temporally the owner of all your USB devices,
not good if you wanna prevent a 'guest account' using your USB devices. 

for 'gid=' : you can now set the id of a group.

then change umask to umask=007 to grant full access to the owner and your
group.

3. restart your computer, enjoy :) (PS because I've spending almost 12 hours
before finding the clue)




MLA-4 wrote:
> 
>     Currently, if I plug in a USB mass-storage device (let's say a card 
> reader) and then mount it (by clicking on the icon that appears on the 
> desktop), the permissions are drwx------ mla mla /media/sda1. 
>     What needs to be modified in order to allow anyone in groups "users"
> to 
> also read/write to the device? E.g., drwxrwx--- mla users /media/sda1. I
> was 
> looking at the scripts in /etc/udev, /etc/hotplug (and hotplug.d),
> /etc/hal, 
> but I'm not seeing where the permissions are set. Maybe I just overlooked 
> something?
>     Thanks,
>     :Peter
> 
> -- 
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
> 
> 

-- 
View this message in context: http://www.nabble.com/USB-device-permissions-tp3470135p17555943.html
Sent from the kubuntu-users mailing list archive at Nabble.com.





More information about the kubuntu-users mailing list