I need to change my unix password over 10+ servers. I am not an SA, just a user. I am on Solaris 10 using ksh. I would like a script that runs through a host list and changes the password.
The script above is great, but we are not allowed to use telnet here at work. We have to use ssh to get into another server. I tried using ssh with the script above and it doesnt work. I can't use third party utilities. Any ideas would be greatly appreciated.
So, now the code seems to work up until it trys to pass the $OLDPASS variable. It just sits there at the password prompt on the remote server
#
# Section 1 --- Prove that we can talk with the hosts in HOSTLIST
HOSTLIST="myserver.net"
DELAY=3
stty -echo
print -n Enter Old Password-
read OLDPASS
print
print -n Enter New Password-
read NEWPASS
print
stty echo
USER=$(whoami)
exec 4>&1
#
# Section 1 --- Prove that we can talk with the hosts in HOSTLIST
# Part 1 --- telnet to each and touch a file
for HOST in $HOSTLIST ; do
ssh -T $HOST >&4 2>&4 |&
sleep $DELAY
##print -p $USER
sleep $DELAY
print -p $OLDPASS
sleep $DELAY
print -p touch changepassdatafile.$HOST
sleep $DELAY
print -p exit
wait
done