LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-07-2006, 10:10 AM   #1
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Rep: Reputation: 30
making a fat32 partition read-only or unaccessible for a user, but rw to another


I have a very neglijent user that I have to let on my computer and I'm concerned about some data I have on a fat32 partition. (with my home dir it was much simpler... I should make it an ext3 partition as soon as I get enough time to make a backup)
The question is, can I either mount it as read-only for his user and rw for mine, or mounting it just when I log in, or anything?
I was thinking of the following things I could do:
1) mounting it in a folder, for example, /mnt/folder1/folder2 and making folder1 readable only for my user. It should block the access of the user and it's fairly simple.
2) when are the scripts in init.d run? Before or after login? If it's after, I could write a script that mounts it by certain parameters according to the user that is logged in.

Which one would be better? Or do you have any other suggestions? Or any security tips I should use to keep my computer safe?

Thanks for reading, any idea is welcomed.
 
Old 12-07-2006, 12:50 PM   #2
sn68
Member
 
Registered: Oct 2005
Distribution: FC5
Posts: 338

Rep: Reputation: 30
You can mount the FAT32 partition as rw for root & read only for all others,
So that when you want to write to the partition you can su/login as root and write(I prefer being logged as normal user and change to root by executing the program from shell after su/sudo if I have to write to mounted partition) and for others the partition is read only
 
Old 12-07-2006, 01:14 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
There are three mount options you can use here.

uid=username --sets the owner of the drive to a specific user name.

gid=groupname --sets the group name the drive will have.

umask=000 --sets the permissions level for the drive. The number is the inverse of the actual permissions you want. 000 would equal 777 permissions. There are also fmask and dmask options for files and directories if you want more fine-grained control.

What I'd probably do is create a "fatdrive" group and set the gid to that, then use umask to set the drive permissions to 775 (umask=002) or such, so that only the owner and members of the group have full write access. Then I can simply refuse group membership to any user I don't want to give write access to.
 
Old 12-07-2006, 01:26 PM   #4
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Original Poster
Rep: Reputation: 30
Thank you both for your replies.

David the H., I was wondering once what uid,gid and umask were... Thanks, it is a much better and easier method this way Although I think I'll make it writable to the user only and readable by the group (if I remember what the chmod value is, and find out what the umask value for that is... but I'll google this one)

Thanks again, problem (soon to be) solved.
 
  


Reply



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
Mounted read-write Fat32 partition suddenly becomes read-only?? hohead Linux - General 8 04-05-2007 12:17 PM
making FAT32 partition reakinator Linux - Newbie 5 10-14-2005 08:51 PM
Having trouble making Fat32 Partition eggoz Linux - Hardware 1 09-18-2005 10:12 PM
making a fat32 partition tintilin Slackware 19 12-05-2004 12:45 PM
Making mounted FAT32 partition writable by all jrittvo Fedora 14 06-07-2004 02:39 AM

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

All times are GMT -5. The time now is 11:52 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