Solved: Partition permissions for different users

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Lantesh

Solved: Partition permissions for different users

Post by Lantesh »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: Partition permissions for different users

Post by Husse »

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

Re: Partition permissions for different users

Post by Lantesh »

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

Re: Partition permissions for different users

Post by Fred »

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
Lantesh

Re: Partition permissions for different users

Post by Lantesh »

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

Re: Partition permissions for different users

Post by Husse »

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
Fred

Re: Partition permissions for different users

Post by Fred »

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
Lantesh

Re: Partition permissions for different users

Post by Lantesh »

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!
Fred

Re: Partition permissions for different users

Post by Fred »

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
Lantesh

Solved: Re: Partition permissions for different users

Post by Lantesh »

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

Re: Partition permissions for different users

Post by Fred »

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

Fred
Husse

Re: Solved: Partition permissions for different users

Post by Husse »

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
Lantesh

Re: Solved: Partition permissions for different users

Post by Lantesh »

Husse that thread has some great information. I've got it bookmarked!
Locked

Return to “Installation & Boot”