Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Samba shared file permissions do not transend to sub folders/files

Posted on 2010-08-30
9
Medium Priority
?
418 Views
Last Modified: 2012-05-10
We use RHEL5.3 with the default Samba version 3.0.33, when a Windows user drops a file into a Samba share, no other users can access the file because it is owned by that user.
Is there a way to allow Linux to propograte permissions from the root object to all sub files and directories when a new file/directory is added.
0
Comment
Question by:Starrett2005
  • 4
  • 2
  • 2
  • +1
9 Comments
 

Expert Comment

by:AtlanticNetworking
ID: 33561507
If you

chown -R root:users /home/shares/allusers/
chmod -R ug+rwx,o+rx-w /home/shares/allusers/

Where /home/shares/allusers/ is your shared directory

Also ensure in smb.conf;

[allusers]
  path = /home/shares/allusers
  valid users = @users
  force group = users
  create mask = 0660
  directory mask = 0771
  writable = yes

That should work
0
 
LVL 16

Expert Comment

by:JammyPak
ID: 33562257
I think you want to include g+s on the group option for chmod...that way the group owner of the parent directory will also be the group owner for anything added to that directory. If the group has permissions on the parent, they will be inherited.

chmod -R g+rwxs <top-level-folder>

0
 
LVL 4

Expert Comment

by:Blundey
ID: 33564939
I tend to add users into the same group for the same share. This makes managing the security easier for myself.

This is a snippet of my smb.conf

[Company Name]
path = /shares/CoName
writeable = yes
browseable = yes
valid users = user1, user2, user3, user4
create mask = 0770
directory mask = 0770
force create mode = 0770
force directory mode = 0770
force group = +jhp

Then do a restart of the samba service and all should be well

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Starrett2005
ID: 33568805
Reset permissions first to:
chmod -R 0770 /u01/US/

chmod -R ug+rwx,o+rx-w /u01/US/
Results:
-rwxrwxr-x  applssd programmers  root:object_r:file_t             LMISRDB1.fmb
-rwxr--r--  testuser domain users root:object_r:file_t            Dropped_File.xls
-rwxrwxr-x  applssd programmers  root:object_r:file_t             MRPATPRS.fmb

chmod -R g+rwxs /u01/US/
Results:
-rwxrws---  applssd programmers root:object_r:file_t             LMISRDB1.fmb
-rwxr--r--  testuser programmers root:object_r:file_t            Dropped_File.xls
-rwxrws---  applssd programmers root:object_r:file_t             MRPATPRS.fmb

Neither of these solutions produce the results I need, the "Programmers" and "Domain Users" security groups are Windows Active Directory. The "applssd" is the local linux Oracle account, if this account cannot access the file then Oracle cannot use the updated file.
I need to ensure that the user account "applssd" and the "Programmers" can access the files to read(applssd) or modify(Programmers).
I do not want to use the Public security attribute for security reasons.
Anymore ideas?
0
 
LVL 4

Expert Comment

by:Blundey
ID: 33568832
Have you considered adding the users to the groups file that need shared permissions?
0
 
LVL 16

Expert Comment

by:JammyPak
ID: 33569025
did you set the 's' bit on the group using chown like I suggested? that way if 'programmers' group-owns the parent folder, they will also group-own items added to the folder (rather than domain admins)

is applssd a member of programmers?
0
 

Author Comment

by:Starrett2005
ID: 33569342
Blundey, not sure what your saying.

JammyPack, yes added the 's' bit that came closest to what i need, but the owner is still the user that dropped the file there.
I cannot add the applssd user to "Programmers" because "Programers" is a Windows Domain group and "applssd" is a Linux local user account
If "applssd" user cannot access the updated file then the file cannot be used by Oracle until we manually reset permissions so "applssd" is the owner.
Again, I would perfer not to use the "Public" security attribute to get around this.
0
 

Accepted Solution

by:
Starrett2005 earned 0 total points
ID: 34041808
I created a script that reset's owner an group permissions every 4 hours.  This solved the problem but feels like a bandaid.
0
 

Author Closing Comment

by:Starrett2005
ID: 37736802
This what worked
0

Featured Post

Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question