Sponsored Content
Operating Systems AIX script for finding all the users with GID 0 ( admin group ) Post 302334314 by zaxxon on Wednesday 15th of July 2009 08:36:07 AM
Old 07-15-2009
For just having a glance at it:
Code:
sort -t":" -nr -k3,3 /etc/passwd

The users with gid 0 will be listed at the bottom. To reverse remove the -r.


For further usage of the output you might want something like:
Code:
awk -F":" '$3 == 0 {print}' /etc/passwd


This is no AIX specific topic so next time post in the subforum for Shell Scripting please, ty.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync - Preserve owner/group with different UID/GID

Dear Folks :-) I want to rsync some files between some servers and preserve files owner and group (not UID or GID), in some machines UID and GID are differents, for example: a) In the rsync server: # stat vbseo.php File: `vbseo.php' Size: 26758 Blocks: 56 IO... (1 Reply)
Discussion started by: Santi
1 Replies

2. UNIX for Dummies Questions & Answers

Get the gid from a group name

Hi there, One can easily retrieve the uid from a username : id -u $username But how can we easily retrieve the gid from a group name? I mean is there a command without using sed? sed -nr "s/^$groupname:x:(+):.*/\1/p" /etc/group Thanks for your help Santiago (7 Replies)
Discussion started by: chebarbudo
7 Replies

3. AIX

Gid=0 and 7 + admin=FALSE

Checking configuration access files for an AIX server, left me wondering about this :confused:: If a user is added to system group, it gets gid=0 with some security risks because it gets some root kind of file access level. Is this insecure condition kept if the user has admin variable... (0 Replies)
Discussion started by: bkiddo
0 Replies

4. Shell Programming and Scripting

Append users if GID exists

I have thousands of users assigned various roles. The role header defines the GID that they should have. If I can get all the GID information into /etc/group format I can upload the output file and easily assign all users into the desired GID. Right now I can get an output file like this:... (5 Replies)
Discussion started by: MaindotC
5 Replies

5. Red Hat

Problem with Script to email Admin users with expired passwords writed byygemici

Hi, I have problem with a script, it was working for 6 month and suddenly I started getting strange expire times example: # chage -l wXXp Last password change : Oct 28, 2014 Password expires : Nov 27, 2014 Password... (3 Replies)
Discussion started by: redmansas
3 Replies

6. UNIX for Dummies Questions & Answers

Conflicting GID in group and passwd files.

Hi guys, I have a question. In the passwd file, user johndoe has a GID of 100 which is the group named users in the group file. But if you check the group file, johndoe is not listed under GID 100, but under GID 33, which is the group named videos. Under what group does johndoe really belong,... (1 Reply)
Discussion started by: goldenlight1814
1 Replies

7. AIX

UID & GID instead of user name and group name

Hi Everyone, We are encountering the following issue on AIX 5.3. When we do ls -ltr the list displays only user id and group id instead of user name and group name. This is happening for all users except root. Whe we do ls -ltr with root user it shows perfectly fine. When we searched... (25 Replies)
Discussion started by: madhav.kunapa
25 Replies

8. Homework & Coursework Questions

Display info about users (UID GID processes terminal)

I would like to get an opinion for my solution for this task and get feedback about better approach or mistakes I have made. 1. The problem statement, all variables and given/known data: The task is to create a script which prints information about users whose names are specified in the... (2 Replies)
Discussion started by: kornfan
2 Replies

9. HP-UX

Creating a group of users with script

Hi, I have a file with usernames, and the comment section, e.g : Data removed by request of sanchitadutta91, 20 May 2020 I need to add these users into a server. Is it possible to use a script to create the users, together with the comment ? From the commandline to add one user, the... (2 Replies)
Discussion started by: anaigini45
2 Replies
vipw(8) 						      System Manager's Manual							   vipw(8)

NAME
vipw,vigr - edit the password, group or shadow file SYNOPSIS
vipw [-g|-p|-s] vigr [-g|-p|-s] DESCRIPTION
vipw/vigr edits the passwd,group or shadow file after setting the appropriate locks to prevent file corruption. vipw edits per default the /etc/passwd file, vigr the /etc/group file. Extended attributes (like ACLs or security attributes) are preserved. ENVIRONMENT
EDITOR If the environment variable exists, the editor specified by this variable is used instead of the default vi(1). OPTIONS
-g, --group Edit /etc/group. -p, --passwd Edit /etc/passwd. -s, --shadow Edit /etc/shadow. -u, --usage Print a usage message and exit. --help Print a more verbose help text and exit. Print version information and exit. FILES
/etc/group - group account information /etc/passwd - user account information /etc/shadow - shadow account information SEE ALSO
attr(5), passwd(1), passwd(5), shadow(5), vi(1) AUTHOR
Thorsten Kukuk <kukuk@suse.de> pwdutils October 2003 vipw(8)
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy