Linux Shell expect 自動切換用戶,自動輸入密碼,執行命令

1 #!/usr/bin/expect -f 2 3 set timeout 30 4 spawn ssh -l root 172.21.11.160 5 expect 「password:」 6 send 「1qaz@WSX\r」 7 8 9 expect 「#」 10 send 「cd /home/ls\r」 11 send 「sh test.sh\r」 12 expect 「*」 13 14
相關文章
相關標籤/搜索