Re: multi seat access regulation for block devices with gnu tools?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jelle de Jong wrote:
> Hello everybody,
> 
> I am searching for a solution for the following situation:
> 
> I have created a system where multiple users work at the same time on
> one system (multiseat) Every user has his own usb hub and unique linux
> username and group.
> 
> I created udev rules that setup the group permissions of block devices
> depending on the location where the usb stick is plugged in.
> 
> Creating the following example situation:
> 
> unity:~# ls -hal /dev/sd*
> brw-rw---- 1 root disk  8,  0 okt 26 12:32 /dev/sda
> brw-rw---- 1 root disk  8,  1 okt 26 12:32 /dev/sda1
> brw-rw---- 1 root user0 8, 16 okt 26 12:32 /dev/sdb
> brw-rw---- 1 root user0 8, 17 okt 26 12:32 /dev/sdb1
> brw-rw---- 1 root user1 8, 32 okt 26 12:32 /dev/sdc
> brw-rw---- 1 root user1 8, 33 okt 26 12:32 /dev/sdc1
> 
> So now user0 should not be able to access the device with group user1.
> This works fine with parted, fdisk, dd etcetra. But I would like to be
> able to let the user0 mount its device dev/sdb1.
> 
> So her comes the question, how can I let user0 mounts his usb stick with
> group user0 and how can I let user1 mounts his usb stick with group
> user1 without user0 or user1 being able to access other devices where
> they have group rw permission on...
> 
> Any ideas are welcome,
> 
> Kind regards,
> 
> Jelle de Jong

Some follow up information, I have created a fstab configuration, see
attachment. That makes it possible to let the group owner mount the
devices. However this setup is very buggy and only works with fat file
systems. I would really like to have good maintainable solution to get
this working.

For example when using an usb stick with ext2 or ext3, it will not mount
because it does not now the dmask or fmask options.

Solution that I am searching for:

Only one user can access the device (this is working see the ls -hal)
The owner and group can mount the device, in a way that the owner and
group can read and write file to the file system but that other users
can not do this.

This should be working with multiple file systems and should not require
static /dev/sdx1 in configuration files because there is no guarantee
the needed partitions is called sdx1 or sdx2 or somethings else.

Maybe HAL can help out but i can't find any documentation or examples
how to do something like this?

Any help would be greatly appreciated,

Thanks in advance,

Jelle
unity:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>                                               <dump>  <pass>
proc            /proc           proc    defaults                                                0       0
/dev/sda1       /               ext2    noatime,sync,errors=remount-ro                          0       1
/dev/sdb1       /media/sdb1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdc1       /media/sdc1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdd1       /media/sdd1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sde1       /media/sde1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdf1       /media/sdf1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdg1       /media/sdg1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdh1       /media/sdh1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0
/dev/sdi1       /media/sdi1     auto    group,noauto,noatime,suid,exec,dmask=0007,fmask=0117    0       0

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux