在shell中使用expect+ssh登錄遠程服務器

1.安裝expect工具: ubuntu:apt-get install expect rhel: yum install expect 2.在shell腳本中使用expect,vi exp.sh: #!/usr/bin/expect -f set timeout 30 #設置鏈接超時時長 spawn ssh root@ip_address #登錄服務器用戶和地址 expect "*passwor
相關文章
相關標籤/搜索