pucko
asked on
PHP or Perl script to change user's password?
Can someone point me to a perl or php script that allows the user to change password for a linux machine on a webpage ?
ASKER
Yes the system password. (that you change using the passwd command if you are logged in)
But it's stored in /etc/shadow not passwd
But it's stored in /etc/shadow not passwd
ASKER
and yes it's the same machine
ASKER
If it helps it's a apache webserver. I realy don't care if it's php, perl or whatever.
I need the users to be able to change their passwords through a webpage.
I need the users to be able to change their passwords through a webpage.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you help me create the Form?
Also how and where do I add this sudo entry?
Also how and where do I add this sudo entry?
ASKER
And one thing. Does the user need to enter their old password to do this? (I realy need it to work that way)
The form would look like:
<form action="/cgi-bin/passwd.cg i" method="POST">
Username: <input type="text" name="user" size='8"><br>
Password: <input type="password" name="password" size=20"><br>
<input type="submit">
</form>
You add the sudo entry by using the 'visudo' command.
If you want to have the user specify their old password, then it becomes a lot more complex as you need to use an expect script and trap all the various responses.
<form action="/cgi-bin/passwd.cg
Username: <input type="text" name="user" size='8"><br>
Password: <input type="password" name="password" size=20"><br>
<input type="submit">
</form>
You add the sudo entry by using the 'visudo' command.
If you want to have the user specify their old password, then it becomes a lot more complex as you need to use an expect script and trap all the various responses.
Is the machine that is running the webserver the same machine for which you want to change the password?