随笔-204  评论-90  文章-8  trackbacks-0
#!/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 一凡 阅读(127) 评论(0)  编辑  收藏 所属分类: linux

只有注册用户登录后才能发表评论。


网站导航: