标签:roo pass continue exp one 互信 spawn word 建立
a=`cat ./host`
password=$1
for i in $a
do
/usr/bin/expect << EOF
spawn ssh-copy-id root@$i
expect "continue connecting (yes/no)?"
send "yes\r"
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof
exit
EOF
done
标签:roo pass continue exp one 互信 spawn word 建立
原文地址:https://www.cnblogs.com/jimmyyang/p/12186708.html