自动远程登录脚本

[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

posted @ 2023-07-25 16:05  YIDADA-SRE  阅读(28)  评论(0编辑  收藏  举报