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

Re: passwd.c

I feel really dumn.  although it would be fun to hack the passwd program on my box, i guess i dont need to.  i did find the chpasswd program in the /usr/sbin directory.  sorry about the novice linux user question (i'm not novice to C development, just this linux stuff)

*********** REPLY SEPARATOR  ***********

On 8/3/99 at 5:59 PM Paul Allen wrote:

>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!

thanks Paul!

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