摘要: [root@m01 ~]# ssh-keygen -P '' -f id_rsa 阅读全文
posted @ 2020-10-18 21:26 六月OvO 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1.编写脚本 [root@m01 /shell4]# vim user.sh #!/bin/env bash #循环在指定的服务器创建用户和文件 while read ip pass do /usr/bin/expect <<-END &>/dev/null spawn ssh root@$ip e 阅读全文
posted @ 2020-10-18 21:09 六月OvO 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 远程登录并做一些事情 [root@m01 /shell4]# vim expect.sh #!/usr/bin/env expect set ip 172.16.1.7 set pass 1 set timeout 5 #开启一个程序 spawn ssh $ip #捕获相关内容 expect { " 阅读全文
posted @ 2020-10-18 20:23 六月OvO 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1.下载命令expect [root@m01 /shell4]# yum install -y expect 2.编写脚本 [root@m01 /shell4]# vim expect.sh #!/usr/bin/env expect #开启一个程序 spawn ssh 172.16.1.7 #捕获 阅读全文
posted @ 2020-10-18 19:55 六月OvO 阅读(215) 评论(0) 推荐(0) 编辑