LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to change the default aoto mounted usb permission for linux (http://www.linuxquestions.org/questions/linux-server-73/how-to-change-the-default-aoto-mounted-usb-permission-for-linux-4175431699/)

arnold.king 10-11-2012 11:30 AM

how to change the default aoto mounted usb permission for linux
 
hi all:
as we know , when usb flash disk plug in and aotu mounted , the default permission of the usb flash disk is 700. that means others have no permission . the question: how to make others have rean/write permission for the aotu mounted usb flash disk ? thanks !!

MensaWater 10-11-2012 12:12 PM

If you type "man automount" and "man autofs" you can get more details on how automounts are setup. It is automount that is setup typically to mount CDs, floppies and other removable media.

From my CentOS box when I type "man autofs" it pulls up the manual page from section 8 (equivalent to typing "man 8 autofs). The "SEE ALSO" there references the man page in section 5 so I typed "man 5 autofs" and found the following:

Quote:

If you use the automounter for a filesystem without access permissions
(like vfat), users usually canít write on such a filesystem because it
is mounted as user root. You can solve this problem by passing the
option gid=<gid>, e.g. gid=floppy. The filesystem is then mounted as
group floppy instead of root. Then you can add the users to this group,
and they can write to the filesystem. Hereís an example entry for an
autofs map:

floppy-vfat -fstype=vfat,sync,gid=floppy,umask=002 :/dev/fd0

flirek 10-11-2012 12:23 PM

Quote:

Originally Posted by arnold.king (Post 4803157)
hi all:
as we know , when usb flash disk plug in and aotu mounted , the default permission of the usb flash disk is 700. that means others have no permission . the question: how to make others have rean/write permission for the aotu mounted usb flash disk ? thanks !!

try add umask=022 at 4th field in /etc/fstab for that mountpoint

some example:
label="my_usb_stick" /mnt/usb vfat auto,user,umask=022 0 0


All times are GMT -5. The time now is 02:15 PM.