自动远程登录脚本
[root@shell test]# cat authSsh.sh
!/usr/bin/expect -f
set time 30
set host "10.0.0.99"
set passwd "123456"
spawn ssh root@\(host
expect {
"yes/no" {send "yes\n";exp_continue}
"password:" {send "\)passwd\n"}
}
interact
[root@shell test]# cat authSsh.sh
set time 30
set host "10.0.0.99"
set passwd "123456"
spawn ssh root@\(host
expect {
"yes/no" {send "yes\n";exp_continue}
"password:" {send "\)passwd\n"}
}
interact