ssh免密连接验证
expect -c "
set timeout 30
spawn ssh -p6900 root@${external_ip} hostname
match_max 100000
for {} {1} {} {
expect {
\"yes/no)?\" {
send \"yes\r\"
set timeout -1
} timeout {
exit
} eof {
exit
}
}
}
"