Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password functions

Status
Not open for further replies.

chipperMDW

Programmer
Mar 24, 2002
1,268
US
I've been asked to write a program that allows a user with the proper permissions to change a group of users' passwords to a default temporary password (e.g. when a bunch of students return to school and have all forgotten their passwords). It needs to be able to do them all in one quick sweep, i.e. something like this:

[tt]users: bob dave sally dolly
new password: [/tt](something simple)[tt]
confirm password: [/tt](repeat)[tt]

bob's password was changed successfully.
dave's password was changed successfully.
sally's password was changed successfully.
dolly's password was changed successfully.[/tt]


The problem is that if I were to use the passwd utility, it would, of course, prompt for each user, and I don't want that. Are there any other lower-level password-changing utilities I could use instead? Is there a way to somehow generate the input for passwd? Anyone have any other suggestions?

Thanks,
Michael
 
well you could pipe the passwd call, and the prompts would go to the program instead of the user... check the man pages for popen() and realted matrial. I am sure someone has already written something like this, perhaps try sourceforge ( )?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top