Saturday 17 September 2011

Password changing script

From the master server, create a file which contains all your servers IP Address and make sure ssh-authentication has been enabled between all the servers for the user id which your going to reset the password.!!

#cat /tmp/serverlist.txt
192.13.2.11
192.13.2.10
192.13.2.12
192.13.2.14
#
***************** Passowrd Change in AIX Servers **********************

#for k in `cat /tmp/serverlist.txt`; do echo "############ $k ##########"; ssh $k 'echo "username:newpassword" |/usr/bin/chpasswd -c'; done

***************** Password Change in Rhel-Linux Servers ****************

#for k in `cat /tmp/serverlist.txt`; do echo "############ $k ##########"; ssh $k 'echo "newpassword" |/usr/bin/passwd --stdin username'; done


No comments:

Post a Comment