#!/usr/bin/expect
####################
set pass xxxx
set user yyyy
####################
spawn ssh -p 35000 -o StrictHostKeyChecking=no "${user}@xgrelay.xxxx.com"
expect {
-re ".*Dkey.*" { gets stdin dkey; send "$dkey\r"; exp_continue}
-re "Option>:" { send "1\r" ;}
-re "Password>:" { send "$pass\r" ; exp_continue }
-re "password:" { send "$pass\r" ; exp_continue }
}
posted on 2021-01-18 11:35
一凡 阅读(150)
评论(0) 编辑 收藏 所属分类:
linux