- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- group check ??
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:09 AM
11-12-2003 05:09 AM
Trying to head off a possible problem of to many users on a line before having to split it up.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:10 AM
11-12-2003 05:10 AM
Re: group check ??
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:13 AM
11-12-2003 05:13 AM
Re: group check ??
What I was after is a way to count the login id's on a particular line within /etc/group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:46 AM
11-12-2003 05:46 AM
Re: group check ??
awk -f groupcount.awk < /etc/group > outputfile
Create a file called groupcount.awk and put the following into it:
{idx1=index($0,":");
use1=substr($0,idx1+1);
groupname=substr($0,1,idx1-1);
idx2=index(use1,":");
use2=substr(use1,idx2+1);
idx3=index(use2,":");
use3=substr(use2,idx3+1);
sidx=idx1+idx2+idx3;
if (sidx==length($0))
{print " 0 "groupname;next;}
count=0;
for (idx4=1;idx4
{idx4+=index(substr(use3,idx4),",") ;
count++}
else
{count++;idx4=length(use3);} }
printf ("%4d %s \n", count,groupname);}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 05:59 AM
11-12-2003 05:59 AM
Re: group check ??
here comes another one.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 06:00 AM
11-12-2003 06:00 AM
Re: group check ??
Don't forget that this will not count ALL users within a group. Users that have that group as primary have that data in the /etc/passwd file. /etc/group will only count users that have that group as secondary.
My 2 cents,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 06:10 AM
11-12-2003 06:10 AM
Re: group check ??
Correct me if I am wrong: I think the group file will have all users listed there evenif they are primary or secondary groups. I checked my systems and the users are listed under both their primary and secondary groups.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 06:53 AM
11-12-2003 06:53 AM
Re: group check ??
I believe you're seeing that because you run such a tight ship my friend.
Adding users via SAM or useradd do not - by default - add them to the /etc/group file.
What *does* add them to the group file is Modifying Secondary Group Membership via SAM or the -G of useradd.
System pulls your group ID solely out of /etc/passwd at login.
Cheers,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 07:18 AM
11-12-2003 07:18 AM
Re: group check ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 08:24 AM
11-12-2003 08:24 AM
Re: group check ??
Then SAM was changed to add one user per line. Now it appears that SAM does an intelligent line, creating a duplicate group entry when the line gets too long. Technically, SAM isn't really doing the mods, it is /usr/lbin/usermod.sam so the /usr/sbin/usermod may do something similar.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2003 08:39 AM
11-12-2003 08:39 AM