Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Replicator Changes Directory Rights and Owner

Status
Not open for further replies.

gwinn7

Programmer
Feb 10, 2001
1,004
US
Here in my office, there is a user running a third-party replication program that copies and updates files that are shared on the server.

When the file replicator activates, it copies the files from the user's machine over the same files that exist on the server. What ends up happening is the rights, owner, and group assignments for those files are changed such that other employees can't access them and modify them.

Our server is a Red Hat 7.2 machine running Samba setup as a PDC. All of the workstations are Win98 machines. What I would like is for these replicated files to inherit the same rights that I have assigned to the folder that contains them by default.

Can I do this and prevent this software from changing the file rights?

Thanks in advance,

Gary
gwinn7
A+, Network+
 
Hi,

I guess you could put the following in the [xxxxx] share definition block within smb.conf :

force user = userx
force group = groupx

If that doesn't do the trick, you could also try :

force directory security mode = 770

(that is a bit mask that is OR'd with the normal bit privileges to determine which permission bits the client can change - its normally 000 to allow any bit in rwxrwxrwx to be changed - 777 would prevent any changes at all)

Also, maybe the native linux 'set group id' flag on the directory would work. When that bits set, the groupid is always set to the group owner of directory whenever any files are created. You do that with chmod using a preceding 2 to the normal octal permssions. For example :

# chgrp sambagrp /usr/samba/data1
# chmod 2770 /usr/samba/data1

After that all files in that directory should retain the group 'sambagrp'.

Hope this helps


 
Great, this looks promising. I will give this a try and get back with you.

Thanks!

Gary
gwinn7
 
SOLUTION!

In the Samba configuration file (smb.conf) there is are two directives that set the default rights for users of a share.

Create Mask
Directory Mask

These directives behave similarly to the "chmod" function. To apply a default permission set of 770 in chmod for all sub directories, you would type the following:

chmod -R 770 <mydirectory>

In Samba, you would set the directives as follows

[MyShare]
Create Mask = 0770
Directory Mask = 0770

If you are using GIDs then simply replace the first zero with that number.

Hope this helps other frustrated IT people like I was.

Gary
gwinn7
 
Correction...

&quot;chmod&quot; does NOT apply a default permission set. The command &quot;umask&quot; rather does that. &quot;chmod&quot; only updates the current files and folders as they sit, not for future files.

Now if I can only get my PHP to work properly with PostgreSQL!!! Arg!

Gary
gwinn7
 
hi!

have an idea to easily setup redhat server to win98 client

thanks in advance ____________________________________________________
Invest your time in learning, Not just practicing.

DEK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top