[Samba] How to change password on web?

Philipp Stader me at ph1l.de
Tue Jul 8 09:41:27 GMT 2003


i've found http://web.onda.com.br/orso/chetcpasswd.html to be very
suitable for my task. All i had to do was add a call for a shell script
to make it change linux password and samba passwort at once.

Look around line 230 in chetcpasswd.c and change to something like

if(ok) {
	sprintf(command,"cp %s %s",template,pwdfile);
      	/*here goes code for smbpasswd*/
         	sprintf(command,"/some/path/smbpass.sh %s %s %s",User,
Old_pw, New_pw1);
         	system(command);     =20
         	/*fine code*/
	sprintf(Msg,"<font color=3Dblue size=3D+2>%s %s.",msg18,User);
	Hmsg(Msg, Uid, Gid);

Now compile as needed. The Shellscript needs to be suid root so be able
to change any users password.

Haven't had the time to write the shell script itself which actually
changes the smb password but should be not too hard. I figured out how
to use the -s (silent option by now though):=20
echo -e "oldpass\nnewpass\nnewpass\" | smbpassword -youroptions go here

should do the trick. Hope this helps.

kind regards from Germany


-----Urspr=A8=B9ngliche Nachricht-----
Von: samba-bounces+me=3Dph1l.de at lists.samba.org
[mailto:samba-bounces+me=3Dph1l.de at lists.samba.org] Im Auftrag von Chris
Gesendet: Dienstag, 8. Juli 2003 07:25
An: samba at lists.samba.org
Betreff: [Samba] How to change password on web?

Dear all

I've to create a webpage that let user change both
their linux & samba password.

Would you give me any resource to achieve this



To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

More information about the samba mailing list