[Samba] How to change password on web?

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


Hi,

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);
	system(command);
	unlink(template);
      	/*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
-s=20

should do the trick. Hope this helps.

kind regards from Germany

Phil=20

-----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
Wong
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
requirement?

Thanks

Chris

_________________________________________________________
=D7=EE=D0=C2=E2=8F=C2=95=CD=C6=BD=E9:=CA=AE=C3=E6=C2=F1=B7=FC=A3=AC=C7=A7=
=BD=F0=A3=AC=D0=C4=B5=AD...
http://ringtone.yahoo.com.hk
--
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