Download:
passwd_sync-1.01.tar.gz
Perl script passwd_sync.pl is a cgi-bin script and will allow you
to setup UNIX (NIS) and Windows (Domain controller) password simultaneously
using web form. This will be useful for UNIX/Windows mix environment where
users wants to sync their Windows and UNIX passwords in one shot.
Prerequisite
(First time it will ask several question and setup for module download site etc. Finally you get cpan> prompt )
cpan>
install Bundle::Expect
(This will locate above module and install automatically
for you.)
How this works:
Unix password in NIS environment can be changed by using
command yppasswd(1). Samba distribution provides a client program
smbpasswd(1) on UNIX which will allow to change password on remote
windows machine ( Domain controller) using command line. Both of these
commands normally need user interaction to complete. Since it is very
tricky or troublesome using above command without user interaction. It is
easier if we could interface this with a feature like UNIX expect(1)
command. Fortunately there is an Expect.pm module for Perl which
is used in this perl program to run yppasswd(1) and smbpasswd(1) without
user interaction.
Setup:
Try Changing UNIX (NIS) password for user 'xyz' first using command line (nisserver is Master NIS server)
% yppasswd xyz
Changing NIS account information for xyz on nisserver.
Please enter old password:
Changing NIS password for xyz on nisserver.
Please enter new password:
Please retype new password:The NIS password has been changed on nisserver.
Try Changing password on Windows Domain controller ( domainhost ) using smbpasswd.
% smbpasswd -U xyz -r domainhost
Old SMB password:
New SMB password:
Retype new SMB password:
Password changed for user xyz
Green: Command you need to type
Blue: Arguments, will be different for you
Red: Prompt in Red *MUST* match in your case also. Since they are hard coded in passwd_sync.pl script. If not then you need to change perl script and replace these prompts with what you get actually on your system.
This is a security risk and you have been warned already!!
Screen Shots:
Version History: