Solved: Partition permissions for different users

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Solved: Partition permissions for different users

Postby Lantesh on Wed Apr 30, 2008 11:50 pm

I have a tri-boot system (Windows XP / Edubuntu 8.04 / Mint 4). The Edubuntu partition is for the kids. There are two user accounts set up in Edubuntu. One is for me so I can log in to load software for them and configure things. The other is their user account. I have the partitions for the other OS's and a storage drive set up in fstab so they auto-mount upon boot. Here is the issue. I don't want the kids to have access to the other drive partitions, and even though I have limited their user permissions I can still access the other drive partitions from their account. Does anyone have any ideas on how I can deny access from their user ID, but not mine?
Last edited by Lantesh on Thu May 01, 2008 6:41 pm, edited 1 time in total.
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Linux Mint is funded by ads and donations.
 

Re: Partition permissions for different users

Postby Husse on Thu May 01, 2008 3:39 pm

I've been thinking of this a while, but I can only figure out how to differentiate between root and others
Perhaps I'm ignorant....
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Partition permissions for different users

Postby Lantesh on Thu May 01, 2008 3:45 pm

Well I appreciate the reply regardless. If I can't find a way I'll just disable the partitions in fstab, and manually mount one when I need it. I just thought perhaps there was a better way. Thanks anyway Husse.
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Re: Partition permissions for different users

Postby Fred on Thu May 01, 2008 3:58 pm

Lantesh,

I am assuming that you have more than one user account. One for you and one or more for your children. If this is the case try setting the top folders in their home directories that you don't want them to have access to, to your username ownership. Then set those top folders to forbidden for anyone but the folder owner.

Do the same in the /media folder, if you want to disallow access to a whole partition. You may need to change the fstab permissions for that partition too. But it would be easier to just change the permissions of the top folders on the partition. They could open the partition and see the top folders but couldn't open any of them.

See if that doesn't do the trick for you. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Partition permissions for different users

Postby Lantesh on Thu May 01, 2008 4:59 pm

Well I had some limited success here. First I changed the ownership of /media to my user name. That worked and under the children's account the other partitions while still visible, were not accessible. Unfortunately because the optical drives are also mounted in this folder they are also not accessable from the kids account. So I modified the /media permissions to read only for other users, and then tried to take ownership of the sub-folders where the Windows and Mint partitions are mounted, but I was not able to take ownership of those folders. I'm guessing this is not allowed because they have operating systems on them. So my solution I think is going to be to mount the OS partitions somewhere other than /media, and that will resolve the issues with the optical drives. I'm also curious how I would set permissions for the partitions in fstab. You have me intrigued on that one.
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Re: Partition permissions for different users

Postby Husse on Thu May 01, 2008 5:12 pm

Thanks to Fred - I had some thoughts along those lines but skipped it
I'm also curious how I would set permissions for the partitions in fstab. You have me intrigued on that one.

man fstab
You might not think so but fstab has a manual section and it is actually not too hard to understand if you have some Linux knowledge, which seems to be the case
Remember man is your friend and lots of stuff has a man section
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Partition permissions for different users

Postby Fred on Thu May 01, 2008 5:26 pm

Lantesh,

I believe the least amount of work would be to mount the optical drives in the kids /homes. Create a folder, or set of folders in their /homes for that purpose. In fstab duplicate the optical drive mount line for the number of user accounts you have and set the mount points, one each for each child and each optical drive. Then just leave the /media folder owned by you.

Does that make sense? Remember, you can mount a partition to as many folders as you want, anywhere you want. All you have to do is put another entry in fstab. You just can't mount two partitions to the same mount point or folder.

Or, another way is to leave the /media folder owned by you and create a link in their /homes to the optical drives in /media. That might be even easier. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Partition permissions for different users

Postby Lantesh on Thu May 01, 2008 5:52 pm

Husse wrote:You might not think so but fstab has a manual section and it is actually not too hard to understand if you have some Linux knowledge, which seems to be the case


Hey that is good to know. I've got that filed away in my brain now for the future, and written down in case my brain short circuits, lol.

Fred wrote:Remember, you can mount a partition to as many folders as you want, anywhere you want. All you have to do is put another entry in fstab. You just can't mount two partitions to the same mount point or folder.


I've heard that before, but for some reason it didn't register. I'll remember that now.


Anyway guys I've got this one solved. Of course now that I check back I see you have a different solution from the one I came up with, but that's ok because what I did solved both my issue here, and one I posted in another thread. Basically what I did was create a new folder called /partitions with the ownership of this folder set to my account, and mounted my other partitions in there in folders named after each. I then changed the owner of /media back to root. Now not only does the kids account have access to the optical drives, but they can't see the other partitions at all, let alone access them. Before by mounting the partitions in /media the drives were showing up in the "Places" menu under all accounts. By mounting them elsewhere the system does not consider them drives and does not put them in the "Places" menu. This is great as the kids won't even see them.

Thanks again for the help guys!
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Re: Partition permissions for different users

Postby Fred on Thu May 01, 2008 6:08 pm

Lantesh,

That's what is nice about Linux. There are as many different ways of solving a problem as there are people trying to solve it. Whatever works for you best is the correct solution. :-)

Fred

PS: Please mark the thread solved. Thanks
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Solved: Re: Partition permissions for different users

Postby Lantesh on Thu May 01, 2008 6:20 pm

Well I'm not sure how to mark it as solved. As I'm typing this reply I typed solved in the subject field. I hope that changes it for the whole thread. Thanks again.
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Re: Partition permissions for different users

Postby Fred on Thu May 01, 2008 6:32 pm

Edit the original post and put it in the subject line.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Solved: Partition permissions for different users

Postby Husse on Fri May 02, 2008 6:32 am

I thought about this some time after I closed down the box yesterday
I was thinking along the lines of user ID in fstab in case you wonder but then I read
Note: ext2 and ext3 do not take uid=xxx, gid=xxx, or umask=xxx

Not quite sure about it ....
this is in this really informative post
http://ubuntuforums.org/showthread.php?t=283131
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Solved: Partition permissions for different users

Postby Lantesh on Fri May 02, 2008 4:38 pm

Husse that thread has some great information. I've got it bookmarked!
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 11 guests