Xref: utzoo comp.unix.questions:26827 comp.unix.admin:491 Path: utzoo!attcan!uunet!seismo!dimacs.rutgers.edu!mips!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!yale!mintaka!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions,comp.unix.admin Subject: Re: Changing Passwords From A Batch File Message-ID: <1990Nov12.133951.2104@athena.mit.edu> Date: 12 Nov 90 13:39:51 GMT References: <1990Nov12.035942.14096@sjuphil.uucp> Sender: daemon@athena.mit.edu (Mr Background) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 26 In article <1990Nov12.035942.14096@sjuphil.uucp>, brunette@sjuphil.uucp (Glenn M. Brunette) writes: |> I was wondering if it is possible to change a users password by redirecting |> input from a data file. At our installation, there are about 40 temporary |> accounts that need to exist, but because of problems that we have been having |> with them, we would like to set up a cron that would change the password |> as needed. The cron part is easy, but getting the passwd program to |> recognise the input redirection is what is giving us the program. Does anyone |> have any ideas? Well, presumably if you're changing passwords, you've got root access to the system. So write your own program to edit the passwd file. You're allowed to do that, you're root. If you don't know any of (a) how to encrypt a password in a C program, (b) how to store a new password in the passwd file from a C program, or (c) how to not open security holes while doing the testing, I'd suggest you not do things this way. Alternatively, get Dan Bernstein's "pty" package from the comp.sources.unix archives and do (echo new-password; echo new-password) | pty passwd username -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710