#!/usr/bin/expect set timeout 3 spawn ssh -l root 10.239.81.207 expect "passwd" send "123456\r" interact