If you would have searched on the internet with the things that I have listed I am quite sure you would have got the information. Anyways, here is how you can do:
1. Create groups one for read only access and one for read and write access:
/* The above group will be later configured with ACL to provide users read and write access. */
/* The above group will be later configured with ACL to provide users read only access. */
2. Add users who require read and write access to sharerw group. Following is the command:
Code:
usermod -G sharerw username
3. Add users who require read only access to sharero group. Following is the command:
Code:
usermod -G sharero username
4. Set ACL on your share directory. Suppose your share directory is under /. To setup sharerw group to have read and write access to /share run the following command:
Code:
setfacl -R -m g:sharerw:rwx /share
To setup sharero group to have read only access to /share run the following command:
Code:
setfacl -R -m g:sharero:r-x /share
5. In the samba configuration file you can under your share configuration put the following lines:
Code:
writable = yes
valid users = @sharerw, @sharero
In the above configuration the users file system permission will be taken from ACL. However, if you want to skip step 4 and 5 then you can go with the following option:
4. Directly edit samba configuration file and put the following lines under your share configuration:
Code:
writable=yes
read list = @sharero
write list = @sharerw
I hope this helps.
Note: Make sure that you take backup of Samba configuration file before making any changes