1 #!/usr/bin/expect
2
3 set password redhat
4
5 set timeout -1
6
7 spawn scp test.zip root@192.168.31.200:/home/xiaoxu/test
8 expect {
9 "password" {send "$password\r";}
10 "yes/no" {send "yes\r";exp_continue}
11 }
12 expect eof
13 exit
linux 自动验证密码输入
最新推荐文章于 2023-11-09 21:53:47 发布