Bob Tanner wrote:
> On Tuesday 04 March 2003 08:29 am, Siems, Gregory wrote:
> 
>>How about:
>>
>>useradd ... username
>>echo my_spiffy_password | passwd --stdin username
> 
> 
> look at autopasswd part of the expect package. Look at expect in general, 
> great tool.
> 


http://www.cpan.org/modules/by-authors/id/E/EE/EESTABROO/Passwd-Linux-0.70.tar.gz

even if you don't want to use perl you can still look at this, the guts 
that do the work of safely upated the password file are all written in C.

The only thing is you have to give root access presumably via a suid 
program to whatever changes the password file, so it's inherently dangerous.

Eric


_______________________________________________
Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list