Set permissions to libraries and files copied to the samba4 share


#1

Dear All!
I copied the contents of the old server shares to the new server shares.
How can the new server be reculsive to set permissions for directories and files?
I do not understand! Has this been a problem for anyone?
Best regards: Gyula


#2

Hi,

very few information here but I will try.

If you are talking about Windows-ACLs you might possibly set them through a Windows machine accessing the share.
If you are meant to change the Linux permissions to a defined value yo might use the following commands on the command line (ie PuTTY):

cd /PATH/TO/SHARE
find . -type f -exec chmod 0640 {} \;
find . -type f -exec chown OWNER:GROUP {} \;
find . -type d -exec chmod 0750 {} \;
find . -type d -exec chown OWNER:GROUP {} \;

Replace capital letters accordingly to your environment.

The above script will allow write to OWNER, read to users in same GROUP and deny access to all others. If you need other permissions, you will find loads of hints by searching the net.

/CV