Changing passwords in Scripts

Paul Davey pd at x.co.uk
Sat Feb 23 00:00:00 AEST 1991


>>>>> On 19 Feb 91 20:15:34 GMT, jik at athena.mit.edu (Jonathan I. Kamens) said:

Jonathan> In article <39 at cheops.UUCP>, logier at cheops.UUCP (Rob Logie) writes:
Jonathan> |> 		RE:  Changing passwords from within a shell/c program

Jonathan>   Get Dan Bernstein's "pty" package (available from the comp.sources.unix
Jonathan> archive in volume 23).  Then, you can run "pty passwd" instead of just
Jonathan> "passwd" and pipe the username and password into it.

Jonathan>   I suspect you can also do this with Don Libes' "expect" program (available
Jonathan> in /pub/expect.shar.Z on uunet.uu.net, and in other locations as well).

Alternatively assuming you have networking you could use rsh (or
remsh on SYSV) to handle the ptys for you.

	rsh `hostname` passwd < scriptfile

where scriptfile contains two lines 
eg
foobar
foobar

Not particluarly secure, but quick and fairly widely applicable.


--
 Regards,			 pd at x.co.uk          IXI Limited
	Paul Davey		 pd at ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ      



More information about the Comp.unix.admin mailing list