home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / admin / 6987 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.1 KB  |  29 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!rjf
  3. From: rjf@lincroftnj.ncr.com (51351[efw]-Robert Feddeler(MT4799)T343)
  4. Subject: Re: passwd
  5. Message-ID: <1993Jan8.203531.6430@lincroftnj.ncr.com>
  6. Organization: AT&T/NCR, Lincroft, NJ, USA
  7. References: <1ikbatINNgl8@matt.ksu.ksu.edu>
  8. Distribution: usa
  9. Date: Fri, 8 Jan 1993 20:35:31 GMT
  10. Lines: 17
  11.  
  12. In article <1ikbatINNgl8@matt.ksu.ksu.edu> holland@matt.ksu.ksu.edu (Rich Holland) writes:
  13. >Does anyone know how to make passwd behave non-interactively?  We've tried
  14. >(echo newpass ; echo newpass ) | passwd, but it wants the passwords to be
  15. >typed in from the keyboard.  I need to do this in a script, to set up new
  16. >account passwords...
  17. >
  18. >-- 
  19.  
  20. passwd(1) writes and reads(!) on stderr (file desc 2).  Just because it can,
  21. I suppose.  I didn't actually try it, but something like this might work:
  22.  
  23.  
  24. (echo newpass ; echo newpass ) | passwd 2<&0
  25.  
  26.  
  27. bob.                | Heap big trouble in the land of plenty.
  28. Were these more than just my opinions, they would have cost a bit more.
  29.