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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set umask per group 1

Status
Not open for further replies.

QatQat

IS-IT--Management
Nov 16, 2001
1,031
IT
Hi there,


I have a linux acting as file server for a windoz network.

I have also a number of groups with group shares configured in smb.conf. ( write list = @groupname )

When users create new files only the owner can then edit the file and members of the group can only read it.

How do I set the file permission to RW for all users in a specific group?

Regards,

Qatqat

Life is what happens when you are making other plans.
 
Put these statements in your smb.conf under the share section.
If you're using NIS groups prefix "@" to the groupname.
If you're using Unix groups prefix "+" to the groupname.

Definitely this:
write list = +groupname
force create mode = 0775

Maybe this:
force directory mode = 0775

Then chmod the existing files to the umask.
Make sue you are in the base of the share as defined by the path stament. Then run "chmod -R 775 ./*"

I hope this helps.






## Just because you can do something doesn't mean you should.

Lorenzo Wacondo (System Administrator)
 
I will give it a try.

thanks a lot.


Qatqat

Life is what happens when you are making other plans.
 
Hi IRudebwoy,


It technically works but does not do the job.

here is the setup.

group
groupadd accounts


users
useradd John - linux creates John's primary group "John"

mkdir /home/accounts

chgrp accounts accounts to change the group ownsership of the folder to share.


usermod -G accounts John - to make John member of accounts as secondary group


in smb.conf

[accounts]
path = /home/accounts
public = no
comments = Account_Share
write list = @accounts
force create mode = 0775

if now I create a new file and save it over the share I get the following and I do not think it is wrong:
rwx rwx rx John John newfile

because John has got "John" as primary group.

if I do

usermod -g accounts John

then I assign John to the accounts group as primary group but then user John cannot write in his personal share.

Is there a way to make this work assigning RW permission to a secondary group?

Thanks

Qatqat






Life is what happens when you are making other plans.
 
I forgot to mention this.

Add the following statement to force the created files in the share to the right group

force group = groupname

so it looks like this.

[accounts]
path = /home/accounts
public = no
comments = Account_Share
write list = @accounts
force create mode = 0775
force group = accounts

The created file will have the owner of the user who created it and the group accounts.

I hope this helps.

## Just because you can do something doesn't mean you should.

Lorenzo Wacondo (System Administrator)
 
You are the man!

That's material for a star.

Thanks a lot, it works perfectly.


QatQat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top