Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Dec 1997 18:36:03 -0500 (EST)
From:      "Joe \"Marcus\" Clarke" <jmcla@ocala.cs.miami.edu>
To:        Bill Sandiford <bill@duey.interlinks.net>
Cc:        FreeBSD Questions mail list <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Change Password Script
Message-ID:  <Pine.SGI.3.96.971206201330.5984A-100000@ocala.cs.miami.edu>
In-Reply-To: <Pine.BSF.3.96.971206200738.29173A-100000@duey.interlinks.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm not really sure what uid will be running this script, but from the
sounds of it, it will be root.  So, use Perl to edit /etc/master.passwd.
It's a plain text file.  Perl has a crypt routine that accepts a string
and a salt, and returns the encrypted version.  Use that to encrypt the
password, then write it out to /etc/master.passwd.  When you're done,
run pwd_mkdb /etc/master.passwd to get the password change to work.

Joe Clarke

On Sat, 6 Dec 1997, Bill Sandiford wrote:

> I need some help
> 
> I need to write a script that will change a users script from the command
> line.  The format would be something like :
> 
> change_pass username newpassword
> 
> 
> Problem is that I can't find a way to pass the variables to passwd and
> have them go in correctly.  Someone suggested before that I use pw to feed
> in the password, but I can't figure that out either.  I was also told that
> writing a script to do this could be vulnerable because someone could type
> ps and read the password.  This doesn't matter to me, as my box is secure
> and noone can get access to a shell.
> 
> Thanks in advance
> 
> Bill Sandiford
> 
> 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SGI.3.96.971206201330.5984A-100000>