*BSD News Article 86360


Return to BSD News archive

#! rnews 2103 bsd
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!vixen.cso.uiuc.edu!news.stealth.net!oksennus.binary.net!not-for-mail
From: Bill Hilburn <billh@binary.net>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How to write the program to get the new password
Date: Fri, 10 Jan 1997 21:54:52 -0600
Organization: Binary Net, Inc.
Lines: 36
Message-ID: <32D70F0C.3C75@binary.net>
References: <32d2cbd4.10524399@news.hinet.net>
Reply-To: billh@binary.net
NNTP-Posting-Host: lnk-ppp-33.binary.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01Gold (Win95; I)
To: Steel Tsai <steel@mail.ntis.com.tw>
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:33733

Hello Steel Tsai !

More than likely you will not find much help with, number one
no one with the answer is gonna buy into this, ie.. we don't
simply pass out that kind of secure information.

Any program you write must use the password encryption routines,
they are *always* encrypted, there are routines to do what your
asking (Change the password), write your code to ask the user
for there old password, pass this to the proper routine and
it will be compared (in an encrypted form) to the password in
the database and the return value will tell you if they supplied
the proper password, if true pass the new password to the proper
routine and it will change the password in the database (again
encrypted).

No you will never see the password un-encrypted !

CAUTION: IMPROPER EDITING OF THE PASSWD FILE CAN CAUSE CORRUPTION !!!

All the information you will need is already on any UNIX box that
has the development system.

Hope this helps !
#include <bill.h>
Bill Hilburn
Lincoln School of Commerce
http://www.binary.net/billh
http://www.route155.com

Steel Tsai wrote:
> 
> Hi
>         We known that if we want to chage the password , we must to
> run the passwd command. I have a project that is write a program and
> change the old password. Who can tell me how to do.