home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!usc!wupost!darwin.sura.net!gatech!usenet.ins.cwru.edu!agate!dog.ee.lbl.gov!news!avalon.nwc.navy.mil!saturn!dejesus
- From: dejesus@saturn.nwc.navy.mil (Francisco X DeJesus)
- Newsgroups: comp.unix.admin
- Subject: Re: passwd
- Message-ID: <C0Jyo7.2xL@avalon.nwc.navy.mil>
- Date: 8 Jan 93 20:38:30 GMT
- References: <1ikbatINNgl8@matt.ksu.ksu.edu>
- Sender: usenet@avalon.nwc.navy.mil (NWC News Admin)
- Organization: Science Applications International Corp.
- Lines: 26
-
- In article <1ikbatINNgl8@matt.ksu.ksu.edu> holland@matt.ksu.ksu.edu (Rich Holland) writes:
- >Does anyone know how to make passwd behave non-interactively? We've tried
- >(echo newpass ; echo newpass ) | passwd, but it wants the passwords to be
- >typed in from the keyboard. I need to do this in a script, to set up new
- >account passwords...
- >
-
- If you have "tcl"/"expect" installed, you can use a short "expect" script
- like:
-
- spawn passwd username
- expect "*New Password:"
- send "newpass\r"
- expect "*Re-type new password:"
- send "newpass\r"
-
- ...or something like that.
-
- Check archie for where to find tcl and expect, and you can read more about
- them in comp.lang.tcl. Other options are discussed in the comp.unix.questions
- FAQ (q# 3.9, last time I checked).
- --
- Francisco X DeJesus ----- S A I C ----- dejesus@chinalake.navy.mil
- ------------------------------------------------------------------------------
- * disclaimer: Opinions expressed here are mine. Typos and errors are yours *
- "Duck Season!" "Rabbit Season!" "...rabbit season." "It's Duck Season! SHOOT!"
-