LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-16-2004, 09:13 PM   #1
doorbits
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
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
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

noauto,guest,ro

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.

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

Original Poster
Rep: Reputation: 0
[edit]

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
doorbits
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:32 PM.

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