[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Coercing sane file permissions -- site specific



On Mon, Nov 21, 2016 at 01:53:25PM +0000, Darac Marjal wrote:
On Mon, Nov 21, 2016 at 08:18:39AM -0500, Greg Wooledge wrote:
On Sat, Nov 19, 2016 at 12:51:58PM -0600, Richard Owlett wrote:
I use fat16 and fat32 formatted USB flash drives

When I plug one into my Debian machine I want totally unfettered
read/write access.
[when logged in as root or *ANY* user ID]

You can't.

You have to be root to mount one of these things, or to edit the
/etc/fstab file to give an ordinary user the permission to mount one of
these things.

Let me restate this another way. Greg said "You have to be root to mount ...". Another way to say this is "Only root can mount ...".

What's the difference? If you want to mount you can EITHER switch to root and issue a mount command as root, OR you can install something which runs AS ROOT and mounts the device automatically.

Now, I believe pmount was mentioned in this thread, as was udisks. These demons can be considered brokers. You ask them to mount the disk and they, running as root, mount the disk and set the appropriate permissions to your user.

There is another alternative that I just found, though. With a little hacking, you can get udev itself to mount the drive.

https://www.axllent.org/docs/view/auto-mounting-usb-storage/ shows a set of udev rules that will mount a vfat or ntfs USB stick to "/media/${File System ID or Label}", AND set the user permissions appropriately.

Sorry, slight clarification as I read it again. It will mount ANY new device matching /dev/sd[a-z][0-9], but for vfat and ntfs drives it adds extra options to the mount command.


--
For more information, please reread.


Reply to: