From owner-freebsd-questions Sat Sep 8 5:15:56 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailrelay1.inwind.it (mailrelay1.inwind.it [212.141.54.101]) by hub.freebsd.org (Postfix) with ESMTP id 19F8737B403 for ; Sat, 8 Sep 2001 05:15:52 -0700 (PDT) Received: from [62.98.213.34] (62.98.213.34) by mailrelay1.inwind.it (5.5.029) id 3B83A8CA0025FF02 for freebsd-questions@FreeBSD.ORG; Sat, 8 Sep 2001 14:15:45 +0200 Received: (qmail 1841 invoked by uid 1000); 8 Sep 2001 12:13:47 -0000 Date: Sat, 8 Sep 2001 14:13:47 +0200 From: Francesco Casadei To: Bill Sandiford Cc: freebsd-questions@FreeBSD.ORG Subject: Re: problem with pw command Message-ID: <20010908141347.A1780@goku.kasby> Mail-Followup-To: Bill Sandiford , freebsd-questions@FreeBSD.ORG References: <001d01c137f3$e1fb54d0$0fa06bcf@custinfo> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <001d01c137f3$e1fb54d0$0fa06bcf@custinfo>; from sysop@interlinks.net on Fri, Sep 07, 2001 at 07:21:44PM -0400 X-Operating-System: FreeBSD 4.4-RC i386 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 07, 2001 at 07:21:44PM -0400, Bill Sandiford wrote: > I have a script on my machine that calls the pw command. I have been > running this script for 3 years and it has worked fine. I use it to chan= ge > passwords. it uses the pw command in the following syntax >=20 > echo newpass | pw usermod username >=20 > this has worked fine but suddently today it is dropping out with the > following error >=20 > pw: password update: No such file or directory >=20 > I have tried everything I can but can't fix this >=20 > Please help >=20 >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message >=20 > end of the original message =46rom pw(8) manpage: -h fd This option provides a special interface by which interac=AD tive scripts can set an account password using pw. Because the command line and environment are fundamentally insecure mechanisms by which programs can accept information, pw will only allow setting of account and group passwords via a file descriptor (usually a pipe between an interactive script and the program). sh, bash, ksh and perl all pos=AD sess mechanisms by which this can be done. Alternatively, pw will prompt for the user's password if -h 0 is given, nominating stdin as the file descriptor on which to read the password. Note that this password will be read only once and is intended for use by a script rather than for interactive use. If you wish to have new password confir=AD mation along the lines of passwd(1), this must be imple=AD mented as part of an interactive script that calls pw. If a value of `-' is given as the argument fd, then the password will be set to `*', rendering the account inacces=AD sible via password-based login. So you want to do: # echo newpass | pw usermod username -h 0 Francesco Casadei --=20 You can download my public key from http://digilander.iol.it/fcasadei/ or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...) Key fingerprint is: 1671 9A23 ACB4 520A E7EE 00B0 7EC3 375F 164E B17B --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7mgt6fsM3XxZOsXsRAsaFAJ4jR6jt45NL4n3vWtv/sJfUALfHhACdEgse F7cRbN8h6eEh5znxfMlrYiE= =/+qz -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message