Archives

All posts for the day May 18th, 2011

My co-worker Preston came up with this one.   Works pretty slick and probably will replace our old method of using the expect script.  Make sure you put an extra space between the 2nd $i and echo  so it doesn't show up in history.

 

for i in cat passtest`; do echo $i; ssh $i  ‘echo ‘newpasswd’ | passwd –stdin root’;done

 

where passtest is your list of hosts.