Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

resetting a password entry with setpwent?

by c (Hermit)
on Apr 11, 2002 at 22:56 UTC ( #158443=perlquestion: print w/replies, xml ) Need Help??

c has asked for the wisdom of the Perl Monks concerning the following question:

Can setpwent be used on its own to set the value of a unix user's password? I read through the setpwent PM page, as well as my local linux man page, but the examples are only for the getpw* clan. Am I misinterpreting this function's use?

It seems as though I am as my man page states that setpwent soley positions the file pointer to the beginning of /etc/passwd. In a shadowed environment, am I going down the wrong path?

humbly -c

  • Comment on resetting a password entry with setpwent?

Replies are listed 'Best First'.
Re: resetting a password entry with setpwent?
by tbo (Scribe) on Apr 11, 2002 at 23:55 UTC
    The function setpwent only reads /etc/passwd from the end to the begin (or /etc/shadow if the script is run by root). If you want to set the passwords (in a shadowed environment), you should use Passwd::Linux if the unix is linux.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://158443]
Approved by IlyaM
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2023-01-29 05:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found