- 博客(1)
- 收藏
- 关注
原创 expect ssh免密登录
#!/bin/expect -f set ip [lindex $argv 0 ] #接收第一个参数当做ssh 目标ip set timeout 10 ##设置超时时间 spawn ssh $ip #发起ssh连接 expect { "*yes/no" { send "yes\r"; exp_continue} #匹配输出结果,输入yes "*password:" { send "xxxxx\r" } #匹配输出结果输入密码,因为密码大多
2021-04-28 15:17:54
157
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人