Sponsored Content
Operating Systems Solaris How to remove user from a group using command line Post 302116746 by zazzybob on Tuesday 8th of May 2007 07:01:17 AM
Old 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

Deny dba command to a user group!!

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

awk help required to group output and print a part of group line and original line

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

How to remove those sequence with same amino acid?What command line I should type?

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

Command to remove First and Last line from a File

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

Remove Command-Line Option from String

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

How to remove unwanted elements from the command line?

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

User is a Part of a Group But Group Details Do Not Show the User

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

Cut command doesn't remove (^C) character from only first line

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

Remove a secondary group from user (Linux)

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

Need a command to remove the last word in the first line of a file

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
PTS_REMOVEUSER(1)					       AFS Command Reference						 PTS_REMOVEUSER(1)

NAME
pts_removeuser - Removes a user from a Protection Database group SYNOPSIS
pts removeuser -user <user name>+ -group <group name>+ [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts rem -u <user name>+ -g <group name>+ [-c <cell name>] [-n] [-l] [-f] [-h] DESCRIPTION
The pts removeuser command removes each user or machine named by the -user argument from each group named by the -group argument. To add users to a group, use the pts adduser command. To list group membership, use the pts membership command. To remove users from a group and delete the group's entry completely in a single step, use the pts delete command. CAUTIONS
AFS compiles each user's group membership as he or she authenticates. Any users who have valid tokens when they are removed from a group retain the privileges extended to that group's members until they discard their tokens or reauthenticate. OPTIONS
-name <user name>+ Specifies the name of each user entry or the IP address (complete or wildcard-style) of each machine entry to remove. -group <group name>+ Names each group from which to remove members. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example removes user smith from the groups "staff" and "staff:finance". Note that no switch names are necessary because only a single instance is provided for the first argument (the username). % pts removeuser smith staff staff:finance The following example removes three machine entries, which represent all machines in the ABC Corporation network, from the group "bin-prot": % pts removeuser -user 138.255.0.0 192.12.105.0 192.12.106.0 -group bin-prot PRIVILEGE REQUIRED
The required privilege depends on the setting of the fifth privacy flag in the Protection Database for the group named by the -group argument (use the pts examine command to display the flags): o If it is the hyphen, only the group's owner and members of the system:administrators group can remove members. o If it is lowercase "r", members of the group can also remove other members. (It is not possible to set the fifth flag to uppercase "R".) SEE ALSO
pts(1), pts_adduser(1), pts_examine(1), pts_membership(1), pts_setfields(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_REMOVEUSER(1)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy