Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!acorn!ixi!ixi!pd From: pd@x.co.uk (Paul Davey) Newsgroups: comp.unix.admin Subject: Re: Changing passwords in Scripts Message-ID: Date: 22 Feb 91 13:00:00 GMT References: <39@cheops.UUCP> <1991Feb19.201534.28396@athena.mit.edu> Sender: paul@x.co.uk (Paul Davey) Organization: IXI Ltd. Lines: 30 In-Reply-To: jik@athena.mit.edu's message of 19 Feb 91 20:15:34 GMT >>>>> On 19 Feb 91 20:15:34 GMT, jik@athena.mit.edu (Jonathan I. Kamens) said: Jonathan> In article <39@cheops.UUCP>, logier@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@x.co.uk IXI Limited Paul Davey pd@ixi.uucp 62-74 Burleigh St. ...!uunet!ixi!pd Cambridge U.K. "These are interesting times" +44 223 462 131 CB1 1OJ