05-08-2007
You can use the -G option to usermod to specify a comma separated list of secondary groups you want the user to be a member of - i.e. include all their previous secondary group memberships excluding the group you want to remove them from.
I always just vi /etc/group directly. Far easier than specifying a list of secondary groups to usermod.
Cheers,
ZB
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear all
i am relatively new in using UNIX i have a problem,
We are using IBM Informix Dynamic Server Version 9.40.FC7W4 we have 2 bsic user groups that we are using the 1st is root and another i wasnt to restrict the command "dba" that takes the users of that group to the database. I have... (3 Replies)
Discussion started by: masquerer
3 Replies
2. Shell Programming and Scripting
Hi,
Need awk help to group and print lines to format the output as shown below
INPUT FORMAT
set echo on
set heading on
set spool on
/* SCHEMA1 */ CREATE TABLE T1;
/* SCHEMA1 */ CREATE TABLE T2;
/* SCHEMA1 */ CREATE TABLE T3;
/* SCHEMA1 */ CREATE TABLE T4;
/* SCHEMA1 */ CREATE TABLE T5;... (5 Replies)
Discussion started by: rajan_san
5 Replies
3. Shell Programming and Scripting
My input is listed as:
giNumber RefAminoAcid VarAminoAcid
10190711 P P
10190711 D D
109255248 I A
110349771 A ... (4 Replies)
Discussion started by: patrick chia
4 Replies
4. UNIX for Dummies Questions & Answers
I have a file from which the Header and the Trailer lines need to be removed. They are confirmed to be the first and the last lines in the file.
I have tried a few commands, but not successful yet. It needs to be implemented urgently, hence any help is greatly appreciated.
Raghu
----------... (1 Reply)
Discussion started by: ragz_82
1 Replies
5. Shell Programming and Scripting
I want to add a "-r <remote_host>" option to my ksh script, causing the script to run a script of the same name on the specified remote host. The remote invocation should itself include all the command-line options of the original invocation, less the -r option.
For example, this invocation:
... (7 Replies)
Discussion started by: mattmiller
7 Replies
6. Shell Programming and Scripting
CREATE TYPE "SUPERB"."OE_L2_FOOTERDATA_REC"
OID '1232323232' IS OBJECT
(
AWLSTrxId NUMBER,
AdjPurchaseAmount NUMBER,
Network NUMBER,
ConfigVersion NUMBER
);
/
I wanted my output to be as follow:
CREATE TYPE OE_L2_FOOTERDATA_REC
OID '1232323232'... (7 Replies)
Discussion started by: jediwannabe
7 Replies
7. Red Hat
Hi,
In the following output you can see the the user "richard" is a member on the team/group "developers":
# id richard
uid=10247(richard) gid=100361(developers) groups=100361(developers),10053(testers)
but in the following details of the said group (developers), the said user... (3 Replies)
Discussion started by: indiansoil
3 Replies
8. UNIX for Dummies Questions & Answers
I have a file which has first 2 junk characters(X^C) at beginning of each line in file. When i run cut -c 2- filename it removes junk characters from all lines except on first line it keeps one junk character control C(^C). Not sure why it is not removing only from first line. (2 Replies)
Discussion started by: later_troy
2 Replies
9. UNIX for Dummies Questions & Answers
Oracle Linux 6.6
grid user's secondary groups are asmadmin,asmdba,asmoper and dba
# id -a grid
uid=638(grid) gid=2000(oinstall) groups=2000(oinstall),2100(asmadmin),2200(dba),2300(asmdba),2301(asmoper)
I want to remove dba as the secondary group for grid and keep the remaining ones.
ie. I... (5 Replies)
Discussion started by: John K
5 Replies
10. UNIX for Beginners Questions & Answers
I have a eg file op.txt
This is a cat
This is a fat cat
This is a fat black cat
I want to remove only the word cat from the first alone .can somebody help.
please do wrap your samples in CODE TAGS
As per forum rules. (7 Replies)
Discussion started by: Sharks
7 Replies
LEARN ABOUT CENTOS
groupmems
GROUPMEMS(8) System Management Commands GROUPMEMS(8)
NAME
groupmems - administer members of a user's primary group
SYNOPSIS
groupmems -a user_name | -d user_name | [-g group_name] | -l | -p
DESCRIPTION
The groupmems command allows a user to administer his/her own group membership list without the requirement of superuser privileges. The
groupmems utility is for systems that configure its users to be in their own name sake primary group (i.e., guest / guest).
Only the superuser, as administrator, can use groupmems to alter the memberships of other groups.
OPTIONS
The options which apply to the groupmems command are:
-a, --add user_name
Add an user to the group membership list.
If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
-d, --delete user_name
Delete a user from the group membership list.
If the /etc/gshadow file exist, the user will be removed from the list of members and administrators of the group.
If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
-g, --group group_name
The superuser can specify which group membership list to modify.
-h, --help
Display help message and exit.
-l, --list
List the group membership list.
-p, --purge
Purge all users from the group membership list.
If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
-R, --root CHROOT_DIR
Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
SETUP
The groupmems executable should be in mode 2770 as user root and in group groups. The system administrator can add users to group groups to
allow or disallow them using the groupmems utility to manage their own group membership list.
$ groupadd -r groups
$ chmod 2770 groupmems
$ chown root.groups groupmems
$ groupmems -g groups -a gk4
CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool:
MAX_MEMBERS_PER_GROUP (number)
Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name,
same password, and same GID).
The default value is 0, meaning that there are no limits in the number of members in a group.
This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS
groups are not larger than 1024 characters.
If you need to enforce such limit, you can use 25.
Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really
need it.
FILES
/etc/group
Group account information.
/etc/gshadow
secure group account information
SEE ALSO
chfn(1), chsh(1), passwd(1), groupadd(8), groupdel(8), useradd(8), userdel(8), usermod(8).
shadow-utils 4.1.5.1 05/25/2012 GROUPMEMS(8)