LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] User tool

[ILUG] User tool

Jimmy O'Regan jimregan at lit.compsoc.com
Thu Dec 7 03:11:43 GMT 2000


On Wed, 6 Dec 2000, Liam Bedford wrote:

> On Wed, Dec 06, 2000 at 03:55:12PM +0000, Paul Kelly came forth with:
> > John McDonnell wrote:
> > 
> > >> What's wrong with /etc/passwd? That's got a complete list in a fixed 
> > >> machine-readable format, 
> > > 
> > > one caveat... if the machine is bound to an NIS host, it won't list the
> > > user accounts on the other machine, obviously enough...
> > 
> > True, true. And then you've got all those Other auth modules that PAM 
> > has been busy sprouting - LDAP and SMB for starters.
> > 
Ummmm.... I thought all those PAM modules required entries for the user
with something like a * in the password field?

> I guess you could always do something like:
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> main(void)
> {
> 	struct passwd *userpwentry;
> 
> 	setpwent();
> 
> 	while ( userpwentry = getpwent() ) {
> 		printf("Username %s\n", userpwentry->pw_name);
> 	}
> 	return 0;
> }
> 
Wouldn't awk -F: '{printf "Username %s\n", $1}'</etc/passwd do the same
thing with less typing?
That doesn't deal with the "non user" users on most systems though - on my
box, only 3/34 of the users in /etc/passwd are actual users.

> L.

--
"The Information Superhighway made it possible for the average person
to find out what some nerd thinks about Star Trek"

http://lit.compsoc.com/
http://www.litsu.ie/

GPG Fingerprint: B6C4 9E2B C62F 1B05 FC0D  F543 6800 67C7 FF5D 8291





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell