[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: passwd.c



Mark,

You wrote:

>         could someone please tell me where to find the source to passwd.c?
> 
> Here's my problem.  i have a large text file with usernames/passwords that i need to create on my machine.  I've already ran them through a 'useradd' script, but now i need to set the passwords to the known values so they will not have to create a new password (we are trying to syncrhonize their mail logins on this redhat system with something else)
> 
> i could do this in my code using passwd [username] if the passwd program would accept the password on the command line instead of requiring me to actually type it in.  i've tried piping it, and that didn't work.  and i cannot find the source for this file anywhere.
> 
> Any help would be appreciated

This is perfect for expect.  Or, if you prefer perl to tcl, use Tom
Christianson's Comm.pl.  Either one will  give you a bidirectional
connection to  an arbitrary command such as passwd.  I've  got a
script based on Comm.pl that I use when we need to find all uses of
our root password on any of our ~100 machines and change them.  It
does this by attempting to log into each local account on  every 
machine and, if it succeeds, change the password.  Works great.

If the passwords will all be the same, you could just hack a little
sh or perl script to blast the encrypted password into all of the
passwd records.

If you really want passwd.c, you could do some sort of an rpm query
on a RedHat box to discover which package contains the passwd command,
and then download and install the source rpm for that package.  Seems
like the long way around, though.

Good luck!

Paul Allen
-- 
Paul L. Allen           | voice: (425) 865-3297  fax: (425) 865-2964
Unix Technical Support  | paul.l.allen@boeing.com
Boeing AR&T Site Operations, POB 3707 M/S 7L-68, Seattle, WA 98124-2207
---
Kick, kick, double-pole, glide, breathe, repeat ...  Air is crisp, sun
warm under the blue sky-dome.  Friends move nearby over fresh powder
through silent woods.  Awareness is here, now.  Work is a distant echo.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []