Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using Samba 4 server on Fedora 24 for sometime now. Everything working fine. Recently it is observed that Windows users, who access samba shares, are creating sub-folders which is not desired. The users were instructed not to create folders, but they continue to do so.
I would like to know is there a way to veto or prevent the Windows users from creating sub-folders in any samba shares. They should only able to create permitted file types.
My requirement is not to allow users to create any folders or directories while they can create any number of files without restrictions in the share until the disk permits.
ACLs may either allow or deny read, write or execute with in the folder. If I deny write permissions in the share for any user or group they can neither create folder nor file.
Take a look at "create mask" and "directory mask" in samba's configuration. If you set the directory mask to something like 440 (instead of say, 750), then your windows user should be still able to create a folder (sub-directory) but can not navigate to it to place his/her files there. [I have not tried this !]
OF course, it means you have to have a mechanism to delete these empty directories later on (a script that works out of crontab maybe ? ).
Last edited by Honest Abe; 09-04-2018 at 05:17 AM.
As I said in #4, I have not tried this myself. The idea is theoretical and you have the liberty to try it out or not.
But if it works the way I *think* it would, you'll have a workaround in place till you find the answer out yourself (research, read references/guides/Man pages etc..) or someone more knowledgeable gives you a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.