/tmp/ groups
staff dba
I know I can open /etc/group file and remove that way but there are so
many users
in the group, when I open it with the vi editor the line is way too
long to edit.
Is there a command on AIX that will allow me to remove a user from a
particular
group. In addition, where is the default group "staff" defined. Just
curious about
that. I use mkuser to add users to the system is "staff" the default
group for that
command?
Thanks in advance to all who answer this post.
this will show your the primary group and the groups than user
"username" belongs to
lsuser -a pgrp groups username
the primary group of a user is shown in the /etc/passwd file (or use
the lsuser command)
To find the group id of the "staff" group - awk can test that the 3rd
field is the string "staff" and print the 1st field (the id)
awk -F':' '$1 == "staff" {print $3} ' /etc/group
or
lsgroup staff
so we can see the (group) id of the "staff" group is 1
if you want to see which users have a *primary* group of "staff"
awk -F':' '$4 == "1" {print $1} ' /etc/passwd
so. If your user has a primary group of "staff" and you want to remove
this, then change the primary group to something else, your example
has the group "dba"
[as root]
chuser pgrp=dba username
I'd be a bit careful about removing "staff" but that's your choice.
The "staff" group is defined as part of the standard installation in /
etc/group
yes, "staff" is the default, but you can change this. If you look
through the mkuser man page you will get some hints under the "Files"
section
man chgrpmem