其他分享
首页 > 其他分享> > expect 免交互配置互信

expect 免交互配置互信

作者:互联网

++++++++++++++++++++++++++++++++++++++++

标题:expect 免交互配置互信

时间:2020年3月3日

++++++++++++++++++++++++++++++++++++++++

 

#/usr/bin/env expect

set  ip  192.168.100.100

set  user  root

set  password  centos

set  timeout  5

spawn ssh-copy-id "${user}@${ip} -p 2222"

expect {

  "yes/no" { send "yes\r" ; exp_continue }

  "password" { send "${password}\r" }

}

expect eof

标签:set,ip,send,expect,yes,password,交互,互信
来源: https://www.cnblogs.com/lv1572407/p/12404180.html