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

Re: User access to write vfat partition?



Todd Suess <tsuess@inspace.net> writes:
> Hey gang,
> 
> I want to temporarily allocate some disk space I have spare on my
> /dev/hda1 partition (vfat) and link it to a symbolic link in a users
> directory so he can upload files.  The setup works fine if I create
> links for all the files manually, but if the directory is empty and
> he logs in and tries to upload he gets permission denied, because
> apparently my /cdrive mount point and the /dev/hda1 itself is set to
> user root group root.  These cannot (as far as I have been able to
> figure out so far anyway) be modified with the normal chown/chgrp
> commands, so I am at a loss as to how to give a regular user write
> permission via ftp to this device.  The contents of my fstab are as
> follows:
> 
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point> <type> <options>                  <dump> <pass>
> /dev/hdb1       /             ext2   defaults,errors=remount-ro 0      1
> /dev/hdb2       none          swap   sw                         0      0
> proc            /proc         proc   defaults                   0      0
> /dev/hdb3       /var          ext2   defaults                   0      2
> /dev/hdb5       /home         ext2   defaults                   0      2
> /dev/hdb6       /usr          ext2   defaults                   0      2
> /dev/hda1       /cdrive       vfat   defaults                   0      2
> 
> In reading the mount man page I saw it was possible to allow users
> to mount and unmount a device, but nothing about permissions for
> reading, writing etc depending on user group or name.
> 
> Any suggestions would be most appreiciated,

Well, vfat has absolutely NO idea about permissions and only limited
access modifiers, so there's no way, in the filesystem, to allow a
specific user to access a file on a vfat partition without allowing
them to access the entire partition. Also, vfat won't allow you to
place a symbolic link on it. You can link from your ext2 partition to
a directory on a vfat drive, but not vice versa. You're probably
getting the idea...vfat is dumb. It was intended for a single-user
system and has many limitations associated with it because of that
intention.

If you're willing to allow this user to have access to your entire
partition you can add a group (I called mine windows) and mount the
partition as group writable and add this user to the group. Assuming
the group you want to use has the GID 101 then you can have an entry
in /etc/fstab like:

/dev/hda1  /cdrive  vfat  defaults,uid=0,gid=101,umask=002  0 1

which will mount the drive group writable and owned by the group
associated with GID 101.

Gary


Reply to: