This is a discussion on Is there a way to give public access to directory? within the Linux Security forums, part of the System Security and Security Related category; Anna Cunningham <anna@cunniingham.net> writes: [...] > I created a 2G file using dd for the fake partition, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Anna Cunningham <anna@cunniingham.net> writes:
[...] > I created a 2G file using dd for the fake partition, then mounted the file > as a block device using the loopback device. > > dd if=/dev/zero of=/home/_file bs=1k count=2000000 losetup > /dev/loop7 /home/_file > mke2fs -cj /dev/loop7 2000000 > > > Then I mounted it in my /etc/fstab like this: > > > /home/_file /mnt/LModels ext3 loop=/dev/loop7 0 0 > > It mounts just fine. The problem is that only root can write to it. I > tried adding 'user', 'users', to the options but it made no difference. I > also tried setting chmod a+rw on /mnt/LModels, /home/_file, and chgrp > users on the same, but nothing will give individual users access to the > directory. > > My ultimate goal would be to apply umask=0002 to the mount so that I would > end up with a mount point which had public access for all members of the > users group without messing up their individual umask settings. But umask > is not a valid option when loop= is used on a mount. I also tried setting > gid=100 in the hopes it would figure out it was accessible by members of > groups, but, again, gid is not a valid option. > > Does anyone know if there is a way to open up access to this mount? My bad -- I should have looked into this a little more myself before posting. I can't figure out how to get it to behave the way you want, either. Anyone? |
|
|||
|
>> I created a 2G file using dd for the fake partition, then mounted the >> file as a block device using the loopback device. >> >> dd if=/dev/zero of=/home/_file bs=1k count=2000000 losetup >> /dev/loop7 /home/_file >> mke2fs -cj /dev/loop7 2000000 >> >> >> > My bad -- I should have looked into this a little more myself before > posting. I can't figure out how to get it to behave the way you want, > either. > > Anyone? No - not at all! Your idea was great! It just took a little fooling around to get the permissions set right. I ended up using this line to mount it: /home/_file /mnt/loopdir ext3 rw,loop=/dev/loop7 0 0 I also had to: chmod g+w /home/_file /mnt/loopdir chgrp users /home/_file /mnt/loopdir /dev/loop7 Probably all of those weren't necessary, but I haven't gone through the process of elimination to figure out what's critical yet. Thanks for suggesting the solution. I learned something new. -Jeff |
|
|||
|
Jeff wrote:
> No - not at all! Your idea was great! It just took a little fooling around > to get the permissions set right. I ended up using this line to mount it: > > /home/_file /mnt/loopdir ext3 rw,loop=/dev/loop7 0 0 > > I also had to: > > chmod g+w /home/_file /mnt/loopdir > chgrp users /home/_file /mnt/loopdir /dev/loop7 > > Probably all of those weren't necessary, but I haven't gone through the > process of elimination to figure out what's critical yet. > > Thanks for suggesting the solution. I learned something new. When You're done with all that, would You be kind enough to post a brief summary here (once You made an expert on that of Yourself)...? In particular, I'd be interested in how Your umasks look like and what group (other than users) files are created with. Remember that, initially, that was the basic question. So, can You assign this mount to one specific group, put the users in question into that group and have files created with that group by default, implying "000?" as umask? Or, as You wanted to do, leave the users' umasks unchanged and have permissions set to "0770" on newly crated files on that mount? Thanks in advance, Jack. -- ---------------------------------------------------------------------- My personal reading of the string "MicroSoft" expands to "NanoWeak"... |