LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-03-2018, 10:03 AM   #1
barani_pd
LQ Newbie
 
Registered: Sep 2009
Location: Bangalore, India
Distribution: RHEL, Fedora, Ubuntu
Posts: 26
Blog Entries: 1

Rep: Reputation: 0
Question Veto Users Creating Folders in Samba Shares


Greetings!

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.
 
Old 09-03-2018, 08:50 PM   #2
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Rep: Reputation: 28
it looks like you can use either Posix ACL or SELinux to do that for you. here is a reference to Posix...

Posix ACL

i would suggest that is a good way to go...
 
Old 09-04-2018, 04:34 AM   #3
barani_pd
LQ Newbie
 
Registered: Sep 2009
Location: Bangalore, India
Distribution: RHEL, Fedora, Ubuntu
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Hi Baldur,

Thanks for your reply.

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.

Hope my understanding is correct.
 
Old 09-04-2018, 05:16 AM   #4
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
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.
 
Old 09-04-2018, 05:21 AM   #5
barani_pd
LQ Newbie
 
Registered: Sep 2009
Location: Bangalore, India
Distribution: RHEL, Fedora, Ubuntu
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Hi Abe,

Thanks for your suggestion.

That is what I am doing now but that isn't correct way, isn't it?
 
Old 09-04-2018, 05:52 AM   #6
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
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.
 
  


Reply

Tags
folder, samba4



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Folders and Mounting Shares with SetGID / Samba kc5hwb Linux - Newbie 1 06-16-2015 06:28 PM
Samba and Active Directory: New Users unable to access shares, old users are fine Jelorian Linux - General 2 05-08-2014 06:35 PM
FreeNAS. Creating shares for windows users in a domain? linuxlover.chaitanya Linux - Server 2 06-01-2010 04:54 AM
Samba shares show empty folders Venefyxatu Linux - Wireless Networking 8 06-18-2008 01:50 AM
Trouble creating shares in Samba Night853 Linux - Software 3 03-03-2004 11:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration