how to mount specific drive for specific users in ubuntu 11.04?

hi friends ...

could u tell me how to mount specific drive (ntfs or fat 32) for specific users in ubuntu 11.04 ?
ie ,if there is a user called staff (a desktop user ) ,then he should able to use staff drive only ?

thanks in advance ...:slight_smile:

What you really want is some other options, not different versions of /etc/fstab to mount filesystems specifically for each user. That is possible, you will wish you never tried it, IMO. Basically it involves booting Linux from a flash drive that each user carries around. And the system becomes unbootable without a flash drive. And userA can give his flash drive to userB, then userC flushes his down the toilet by accident. No.

One best bet is to chroot the staff user and mount the disks(s) you want so they can be seen in the chroot jail. This is a major exercise if you've never done - google for 'chroot jail tutorial'

A simpler option is to use ACL's on the mountpoints of any disk/filesystem you want to control. Disallow access by the user staff for those mountpoints. The affected user can do a df -h but will just get errors. They cannot do ANYTHING on those drives. Just be sure you do not block them completely out of system directories like /usr, /etc, /tmp,
/var/tmp and so on. You can prevent staff from writing to /usr, but that should be the default anyway for every user except root.