1833832 Members
2168 Online
110063 Solutions
New Discussion

Default group ownership

 
SOLVED
Go to solution
dictum9
Super Advisor

Default group ownership


Greetings,
For a specific user, I want the default group ownership setting to be 'qms', not 'users'. When I create a file, it defaults to 'users', how can I change that?


# whoami
chlee
#
# groups chlee
qms qms_int users
#
# groups
users qms qms_int
#
# touch a
# ll a
-rw-rw-rw- 1 chlee users 0 Apr 26 11:39 a
#
# grep qms /etc/passwd
qms:1104:202:QMS User:/apps/qms:/sbin/sh
#
# grep qms /etc/group
qms::202:chlee
#

11 REPLIES 11
Jeff_Traigle
Honored Contributor
Solution

Re: Default group ownership

Two instances I can think of where this would happen:

User was logged in and you changed it's group from users to qms. If the user doesn't logoff and login again, the system will retain the old group for that login session.

or

The directory where you are touching the file has the setGID bit set and has group ownership of users. Any files created by any user in the directory would get users group ownership instead of group ownership of the individual user account.
--
Jeff Traigle
A. Clay Stephenson
Acclaimed Contributor

Re: Default group ownership

In addition, consider the case where the file 'a' already existed and a touch command was issued. In that case, only the modification time metadata would be changed but the file's ownership and group would remain unchanged.

I have also seen this behavior where the cached entries stored by the pwgrd daemon were stale. I would stop the pwgrd daemon (and don't restart it for now) and see if the behavior persists after a fresh login of user chlee.
If it ain't broke, I can fix that.
Rasheed Tamton
Honored Contributor

Re: Default group ownership

Greetings,

If you are talking about chlee user
can you do
grep chlee /etc/passwd
(look for the group id in /etc/passwd for chlee - that is the default as far as I remember)
id -a



dictum9
Super Advisor

Re: Default group ownership

The setuid bit is not set:



# ll -d chlee
drwxrwxr-x 15 chlee qms 8192 Apr 26 11:39 chlee

dictum9
Super Advisor

Re: Default group ownership

I meant setgid bit is not set.
dictum9
Super Advisor

Re: Default group ownership

From the /etc/passwd data posted above, it appears that the qms group, as the primary group, should supercede the "users" group.

dictum9
Super Advisor

Re: Default group ownership

I restarted the pwgrd daemon to no avail. Even tried stopping it. The group still defaults to "users", why?
Peter Nikitka
Honored Contributor

Re: Default group ownership

Hi,

can we exclude, that NIS, ... is used as authentication method and not plain file authentication?
Give us
grep passwd /etc/nsswitch.conf
grep group /etc/nsswitch.conf

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
dictum9
Super Advisor

Re: Default group ownership


# grep passwd /etc/nsswitch.conf
passwd: files
#
# grep group /etc/nsswitch.conf
group: files
netgroup: files
Steven E. Protter
Exalted Contributor

Re: Default group ownership

Shalom,

After fixing the /etc/group file and making sure the /etc/passwd file is correct, create a new user with the primary group qms.

See if it works and new files are created correctly.

If this is the case whats happened with this problem user is a result of what happened before you made changes not after.

If the system is or was ever trusted, there may be some default user policy set up. I don't remember where that might be, but sam an be used to check it.

This issue, if the new user works is likely a historical issue with the way the system WAS configured and is no longer configured. The guesses are in the posts above.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
V. Nyga
Honored Contributor

Re: Default group ownership

Hi,

from your comman 'groups' -> 'users qms qms_int', it seems like 'users' is still recognized as the first group.
If you delete 'chlee' from group 'users', is it working now?
Then after reassigning to group 'users', what's showing now?

Volkmar
*** Say 'Thanks' with Kudos ***