Question : Password utility

Is there any utilities or script where we can synchronize password across multiple UNIX server?  I'm not the UNIX admin for the company so I can't setup NIS or setup password synchronization between Windows domain controller and UNIX server that we have.  

As a user, I felt overwhelm with all this server that I need to access and maintain the password all those.  I have access to 14 UNIX server and 3 Windows Domain Controller.  I don't want to access every single UNIX server to update my password and every Windows Domain Controller.  I'm looking an easy way that will help me to synchronize all my password between those 14 UNIX Server and 3 Windows Domain Controller.

If anyone out there has a very easy solution where I can run the script and prompt me with the password change and it will propagate through out without leaving any history of my password in the history file that would be great.

Answer : Password utility

Say you have the hosts all listed in a file, you could do something like

#!/bin/sh
for host in `cat /path/to/hosts`
do
  /path/to/chpass oldpass newpass $host
done

where chpass is an expect script like

#!/usr/bin/expect -f
set opassword [lindex $argv 0]
set npassword [lindex $argv 1]
set host [lindex $argv 2]

spawn ssh $host
match_max 100000
expect "*?assword:*"
send -- "$opassword\r"
spawn passwd
expect "*?assword:*"
send "$opassword\r"
expect "*?assword:*"
send "$npassword\r"
expect "*?assword:*"
send "$npassword\r"
expect eof
Random Solutions  
 
programming4us programming4us