[ale] scripting passwd change

Jeremy T. Bouse undrgrid at toons.UnderGrid.net
Tue Aug 22 18:41:53 EDT 2000


	Actually it's a lil more involved than this if you actually want
to completely automate the process. I ran into this because the PAM 
mechanism itself will actually prompt you to enter the old and new
password... When I was doing it I ended up going with C to write the
routine and basically short-circuit'd the user prompts and got it to
the application to answer the PAM requests itself...

	Respectfully,
	Jeremy T. Bouse
	UnderGrid Network Services, LLC

Fletch was said to been seen saying:
> 
> http://search.cpan.org/search?dist=Authen-PAM
> 
> Examples 
> 
> Here is an example of using PAM for changing the password of the
> current user: 
> 
>   use Authen::PAM;
> 
> 
>   $login_name = getpwuid($<);
> 
> 
>   pam_start("passwd", $login_name, $pamh);
>   pam_chauthtok($pamh);
>   pam_end($pamh);
> 
> 
> or the same thing but using OO style: 
> 
>   $pamh = new Authen::PAM("passwd", $login_name);
>   $pamh->pam_chauthtok;
>   $pamh = 0;  # Force perl to call the destructor for the $pamh
> 
> 
> 
> -- 
> Fletch                | "If you find my answers frightening,       __`'/|
> fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
> 678 443-6239(w)       |  scary questions." -- Jules                =(___)=
>                       |                                               U
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.

-- 
,-----------------------------------------------------------------------------,
| Jeremy T. Bouse  -  UnderGrid Network Services, LLC  -   www.UnderGrid.net  |
|       All messages from this address should be atleast PGP/GPG signed       |
|        Public PGP/GPG fingerprint and location in headers of message        |
|     If received unsigned (without requesting as such) DO NOT trust it!      |
| Jeremy.Bouse at UnderGrid.net  -  NIC Whois: JB5713  -  undrgrid at UnderGrid.net |
`-----------------------------------------------------------------------------'

 PGP signature




More information about the Ale mailing list