DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to have a windows vfat partition available read-only to ordinary users.
I've tried mounting it automatically at boot by an entry in fstab:
/dev/hda9 /mnt/win vfat ro 0 0
and I've tried mounting it explicitly in a terminal:
mount -t vfat /dev/hda9 /mnt/win
Both ways, the permissions for the /win directory and each of the sub-directories and files are listed as:
rwxr--r--
Yet, both ways, it is accessible only to root. Root gets in there just fine, but for ordinary users it's: Permission denied
Why isn't the read permission working?
PS: I tried changing the fstab options entry to defaults instead of ro but it made no difference. The permissions still come up rwxr--r-- and still only root can get open the /mnt/win directory.
Last edited by r.stiltskin; 10-20-2004 at 11:07 PM.
Mount it as a user using the uid= and gid= Set it to something like the uid of nobdy. Still mount it ro but now ordinary users should be able to browse it.
I see, either the ownership has to be set to someone other than root, or the permissions have to be set explicitly, to give access to users.
Mounting it with umask=222 does the trick; that sets permissions to r-xr-xr-x which prevents anybody from writing to that directory.
Also, mounting it as ro, umask=0 works, although it looks wrong since it sets permissions to rwxrwxrwx, but even though it looks like everybody has write access, the ro parameter takes precedence and no writing to the files is permitted.
It was confusing because r--r--r-- permission looked like it should allow reading; I see now that at least r-xr-xr-x (i.e. read & execute permission) is needed to be able to get into a directory.
(darthtux: your umask allows root to write to that directory.)
Last edited by r.stiltskin; 10-21-2004 at 01:46 AM.
Originally posted by r.stiltskin
(darthtux: your umask allows root to write to that directory.)
Yes, I know. You said in the first post " I want to have a windows vfat partition available read-only to ordinary users." Most of the time people want write access for root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.