From owner-freebsd-questions Thu Aug 26 9:45: 7 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mailhub.cns.ksu.edu (grunt.ksu.ksu.edu [129.130.12.17]) by hub.freebsd.org (Postfix) with ESMTP id 7712A14DD5 for ; Thu, 26 Aug 1999 09:45:05 -0700 (PDT) (envelope-from beemern@ksu.edu) Received: from ksu.edu ([129.130.61.24]) by mailhub.cns.ksu.edu (8.9.1/8.9.1/mailhub+tar) with ESMTP id LAA00506; Thu, 26 Aug 1999 11:43:33 -0500 (CDT) Message-ID: <37C56F1D.BCD9ACB6@ksu.edu> Date: Thu, 26 Aug 1999 11:45:17 -0500 From: beemern@ksu.edu X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.3.9 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Francis A. Vidal" Cc: FreeBSD Questions Subject: Re: pw useradd -h option References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Francis A. Vidal" wrote: > how do i change their password non-interactively? BTW, is it normal for > the UID to have the same value if the -N option is used during the entire > lifetime of the script? > as far as changing user passwords automatically, as in, through a script without user input, i'd use a the expect scripting language. i've used it in the past for this type of situation and it works great here is a sample script that i've used to show you how it works in basic form... obviously for more info you can research expect. its also in the ports tree. --snip-- spawn passwd USERNAME expect "New UNIX password:" send "newpassword\r" expect "Retype new UNIX password:" send "newpassword\r" interact --snip-- hope this helps! good luck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message