using bare perl to run Unix passwd

S

smcracraft

Hi,

Anyone know of a Perl program that can
run Unix passwd and set a particular password
for a particular user?

I don't want to have to edit the passwd or shadow
files and want to use the built-in-passwd.

The two caveats on this is: no Expect allowed and
also no Perl libraries other than the standard ones.

Also, this is not on Windows but on Unix.

Thanks anybody/everybody.
 
P

Pat Deegan

Greets,

Hi,

Anyone know of a Perl program that can run Unix passwd and set a
particular password for a particular user?

On my system at least, `passwd` has a --stdin option:
"This option is used to indicate that passwd should
read the new password from standard input,
which can be a pipe."

So opening a pipe to '| passwd --stdin username' should work.

HTH,
Pat D
 
S

smcracraft

passwd does not have a --stdin on most vendor Unixes because
it is considered a security flaw.

I should have been more specific to exclude the above "--stdin"
from the requirement.
 
J

John W. Krahn

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top