Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-16-2004, 09:13 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 18

Rep: Reputation: 0
fstab: giving a user acct read-only access to specific partition

I have looked on google, searching for a way to do this, I know it should be possible, but I didn't find any information on how to do it.

I have a partition (dev/hda2), that I want to make available to the "guest" user, but as read-only.

The relevant line from my /etc/fstab is:

/dev/hda2 /mnt/hda2 vfat auto,rw

Again, only the "guest" user should be able to access the partition, and only in read-only mode. If it is needed, the UID of the guest user is 1001.

Thanks in advance!
Old 05-16-2004, 11:37 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,891

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
fstab is probably the wrong place to try to set such permissions. fstab tells the systems which partitions, devices, etc., can be mounted; not who can access them. Try setting up a Group to identify who is allowed access to the partition, and put the names of the allowed user's in that group. Then use chown to set the group name in the properties.
Old 05-16-2004, 11:44 PM   #3
Senior Member
Registered: Oct 2002
Distribution: Slackware, Windows 7
Posts: 1,253

Rep: Reputation: 55
I believe what you would need to do is set the permissions for the file that serves as the mount point for that partition.

For instance, I have a partition, /dev/hda12, that has a mount point (a directory) named /data-1. I would then set the ownership and read/write permissions of that file so that when it is mounted it would be accessable (or not) as you wish.

If you set the partition to be mounted read only in fstab, this will be a global setting (I believe) and not what you are looking to do. For instance, if you enter in fstab


for the partition, this will make guest the only person, other that root, that can mount the partion, but once mounted, all will have ro access to the partition.

Old 05-17-2004, 01:18 AM   #4
LQ Newbie
Registered: Oct 2003
Posts: 18

Original Poster
Rep: Reputation: 0

I'm not sure what you mean, Franklin.

The partition itself is vfat, chmod won't work on the files themselves. This is what stumps me.

Last edited by doorbits; 05-17-2004 at 01:42 AM.
Old 05-18-2004, 02:11 PM   #5
LQ Newbie
Registered: Oct 2003
Posts: 18

Original Poster
Rep: Reputation: 0
chmoding the /dev/hda2 does not make any difference. Neither does chmoding the /mnt/hda2 (mount point?). Filesystem was umounted before chmod, and remounted afterwards.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
giving user access to 'shutdown -r now' or -h commands Lleb_KCir Linux - General 2 03-16-2005 11:50 AM
FSTAB help on a read only partition microsoft/linux Debian 8 10-14-2004 11:59 AM
Giving Specific users access to the reboot command shassouneh Linux - Security 15 03-24-2004 05:10 PM
FSTAB entry for normal user to access windows partition rmanocha Linux - Software 4 01-29-2004 04:33 PM
giving a user access to my /mnt/windows riddlebox80 Linux - General 1 03-12-2003 05:48 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration