当前位置:网站首页>自动化配置SSH免密登录和取消SSH免密配置脚本
自动化配置SSH免密登录和取消SSH免密配置脚本
2022-07-27 13:26:00 【51CTO】
1. 前文
搭建了一套有多台主机的局域网环境,不完全考虑安全性的情况下,为方便管理局域网内主机,配置SSH免密登录,因主机较多,前阵子针对配置ssh免密和取消ssh免密功能单独写了脚本来自动化批量部署,现把两个功能封装在一起做成交互式程序
2.实现代码
3. 使用方法
3.1 使用前准备
- 将代码复制到脚本文件,赋予执行权限
- 提前准备好IP地址用户密码文件
3.2 IP地址用户密码文件格式(注意!!!)

3.3 运行脚本

4. 使用注意
4.1 IP地址用户密码文件格式请按照以上图示标准填写,内容不正确时会出现等待ssh登录或者重试的结果,这时候需要检查配置文件的用户名或者密码是否错误

4.2 未在配置ssh免密的情况使用脚本,需要多次ctrl+c强制退出脚本

代码干货分享,如果你有不一样的想法,欢迎一起交流学习~
边栏推荐
- Failed to connect to ResourceManager
- Cognition -- classic of the road to success of hardware engineers
- @Repository详解
- JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
- Shell编程规范与变量
- Docker实践经验:Docker 上部署 mysql8 主从复制
- @Detailed explanation of repository
- PROFINET simulator tutorial
- watch VS watchEffect
- Hard deduction SQL statement exercises, wrong question records
猜你喜欢

windows10 安装Sql Server 2019

STM32——电容触摸按键实验

灵活易用所见即所得的可视化报表
How to solve cache avalanche, breakdown and penetration problems

基于企业知识图谱的企业关联关系挖掘
![[popular science] the difference and connection between accuracy and resolution](/img/12/efcce1f6b8801d8d8b08b79818632c.png)
[popular science] the difference and connection between accuracy and resolution

Chapter 3 business function development (view clue details)
![[idea] set to extract serialVersionUID](/img/ef/7eee4639cd4306a2a7a53d73528bbd.png)
[idea] set to extract serialVersionUID

YOLOX改进之一:添加CBAM、SE、ECA注意力机制

Rtl8762dk environment construction (I)
随机推荐
spark job 使用log4j appender 追加日志到本地文件或者mysql
进程间通信
Hard deduction SQL statement exercises, wrong question records
[cache series] completely solve the problems of cache avalanche, breakdown and penetration
log4j2 jdbc appender
2022 Niuke multi School II_ E I
Docker practical experience: deploy mysql8 master-slave replication on docker
Annual comprehensive analysis of China's online video market in 2022
poj3461 Oulipo【KMP】
Summary of basic knowledge of C language
DVWA full level customs clearance tutorial
C语言基础练习题目
面试八股文之·TCP协议
[idea] set to extract serialVersionUID
Getting started for beginners: build your own blog with WordPress
连接ResourceManager 失败
Win11壁纸变黑怎么办?Win11壁纸变黑了的解决方法
Unity3d learning note 10 - texture array
网上券商APP开户安全有保障吗?
万字详解 Google Play 上架应用标准包格式 AAB