#!/usr/bin/expect -f set timeout 60 spawn ssh -D 7070 host expect "password:" send "xiaobao001\r" interact
会报找不到expect ,是因用用sh执行,不会解释第一行,而应该把些脚本有执行
#!/usr/bin/expect -f set timeout 60 spawn ssh -D 7070 host expect "password:" send "xiaobao001\r" interact