1825693 Members
3355 Online
109686 Solutions
New Discussion

owner group

 
j773303
Super Advisor

owner group

Is it possible create files the owner group alway are G3,
for example: A user belogn to group G1, B user belong to group G2, is it possible using A and B user create files the group will belong to G3?
Hero
6 REPLIES 6
malay boy
Trusted Contributor

Re: owner group

Yap no problem.A and B can create file next changed the owner to G3.

example :
as use A do :
# echo "" > /tmp/test
next
# chown C:G3 /tmp/test.



This will do.

regards
mB
There are three person in my team-Me ,myself and I.
j773303
Super Advisor

Re: owner group

I mean is that create file later, the owner group auto
to set to G3, not use the chown again?
Hero
Leif Halvarsson_2
Honored Contributor

Re: owner group

Both yser has to belong to both groups. If user B has G1 as primary group and do a
newgrp G3
All files created after that belongs to group G3. The same for user B.
malay boy
Trusted Contributor

Re: owner group

OK you mean that user A (belong to group G1) create a file an automatically the group for that file are G3.

Which I don't think soo...

regards
mB
There are three person in my team-Me ,myself and I.
Jean-Louis Phelix
Honored Contributor

Re: owner group

hi,

No, the group when you create a file will always be the login group. But if user A also belongs to group G3 as a member in /etc/group, he will be able to use the 'newgrp G3' command. After that, files will be created with group G3 for this session.

Regards.
It works for me (© Bill McNAMARA ...)
j773303
Super Advisor

Re: owner group

I find the solution,use chmod to change set the group-id as below,


2000 (= g=s) Set-group-id on file execution

for ex: chmod 2777 /tmp, then all user created files are belong to /tmp owner group-id.
Hero