Set permissions to libraries and files copied to the samba4 share

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


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):

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.


I was thinking of the next …
I’m creating a new server with shares. I copy files from the old server to the shares of the new server.
Sharing permissions should be set on files and directories copied to the new server.
Neither did the above suggestions.
I could only solve the problem by copying the files to a Windows domain user.

Best regards: GYULA