How to let users change linux password from web browser? [closed]

Solution 1:

web-chpass can change passwords through PAM.

Solution 2:

I prefer to use 2 separate processes. One process makes a request by dropping a special file into a special folder. Second, a cron job loops through the folder and fulfills the password change requests.

All the calling script needs to do is drop the file into the folder (provided it has permissions to do so.

Please see this link for more details and to get the scripts: http://sylnsr.blogspot.com/2012/09/keep-unix-password-in-sync-with.html

Solution 3:

If you are running Samba as a PDC you could use it to allow users to change their password using ctrl+alt+delete. I am sorry if the this anwser does not suit you but i cannot post commets or so yet...

    unix password sync = Yes

    passwd program = /usr/bin/php -f /my_folder/my_own_script.php %u
    passwd chat = "password:" %n\n "changed"
    passwd chat debug = yes

or the system program:

passwd program = /usr/bin/passwd %u
passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n  *passwd:*all*authentication*tokens*updated*successfully*

search for "Password Synchronization" it is by the middle of the document and explains better how it works: http://www.samba.org/samba/docs/using_samba/ch09.html#samba2-CHP-9-SECT-4.3