当前位置:网站首页>SSH自动重连脚本
SSH自动重连脚本
2022-07-31 05:11:00 【tcliuwenwen】
博文背景
实现SSH的自动重连,比如机器正在开机或者网速慢,可以自行不断尝试,直至成功连接。
具体操作
index=0;
for ((i=1;i<=10;i++));
do sshpass -p xxxxxxx ssh -o PreferredAuthentications=password -o StrictHostKeyChecking=no -o ConnectTimeout=3 [email protected] 'echo';
if [[ $? -eq 0 ]];
then
index=1;
break;
fi;
done;
if [[ "$index" -eq 1 ]];
then sshpass -p xxxxxxx ssh -o PreferredAuthentications=password -o StrictHostKeyChecking=no -o ConnectTimeout=3 [email protected];
fi
边栏推荐
- MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
- 数字取证autopsy工具用法
- Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘
- MySQL高级语句(一)
- leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
- Volatility取证工具使用日记
- mysql password modification method in Linux (pro-test available)
- Redis:简单实用
- [Cloud native] Open source data analysis SPL easily copes with T+0
- Regular Expression Basics
猜你喜欢

数据库 | SQL增删改查基础语法

feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r

DeFi 项目中的治理Token

What is an EVM Compatible Chain?
Getting to know regular expressions

MySQL面试题大全(陆续更新)
![[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version](/img/7e/1d27e3f1856ab8c6cbfc5221c717bb.png)
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version

【云原生】微服务Nacos的简单介绍与使用

gin框架学习-Casbin进阶之策略管理API使用方法

05 【绑定样式 条件渲染 列表渲染】
随机推荐
07 【内置指令 自定义指令】
MySql创建数据表
Access数据库的查询
初识正则表达式
leetcode-每日一题735. 行星碰撞(栈模拟)
什么是EVM兼容链?
12 【网页布局总结 元素的显示与隐藏】
02 【el和data的两种写法 MVVM模型】
11 【定位】
【windows】--- SQL Server 2008 超详细安装教程
MySQL压缩包方式安装,傻瓜式教学
[Cloud native] Simple introduction and use of microservice Nacos
对js的数组的理解
Linux修改MySQL数据库密码
MySQL高级语句(一)
Common JVM interview questions and answers
11 【组件通信】
vulhub靶场学习日记hackme2
Why is the redis single-threaded also so fast?
Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?