脚本连接linux服务器

#!/usr/bin/expect -f
set user root 
set host xx.xx.xx.xxx
set password xxxxx
set timeout -1

spawn ssh $user@$host
expect "password:*"
send "$password\r"
interact

 

posted @ 2020-06-10 18:18  花兮  阅读(295)  评论(0编辑  收藏  举报