Sample for 2-level share

For test, and help ( click - able all)

How it work


All users can create in your home directory folders and files. They can remove created by them. Other users can not see what the user has made in its own directory
In addition, users have access to shared folders public and family , the user1, user2 and user3 have access to  folders public and family, and the users4, user5, only the public folder
Folders public and family inside user folder is virtual folders. All files from them stored in shared folder with same name.
For example
data/user1/public ---> data/public
data/user5/public ---> data/public

Construction

            mkdir -p /mnt/data/me/public
            mkdir -p /mnt/data/brother/public
            mkdir -p /mnt/data/father/public
            mkdir -p /mnt/data/friend1/public
            mkdir -p /mnt/data/friend2/public
            mkdir /mnt/data/me/family
            mkdir /mnt/data/brother/family
            mkdir /mnt/data/father/family
            mkdir /mnt/data/family
            mkdir /mnt/data/public

defined users

Each user defined as

pathes  to user's  home dirs 
/mnt/data/me   -     for user me
/mnt/data/brother ...... brother
/mnt/data/father ...... father
/mnt/data/friend1 ...... friend1
/mnt/data/friend2 ....... friend2

Samba share ( I define only one samba share, no need hidden share )

uncheck permissions inherit and add auxiliary parameters as create mask = 0664 and directory mask = 0775 
Scripts





Comments