当前位置:网站首页>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
边栏推荐
- Yuan prospect and four track of the universe
- How MySQL - depots table?A look at will understand
- DeFi Token in the project management
- 阿里云中mysql数据库被攻击了,最终数据找回来了
- Access database query
- Memcached :安装
- On the side of Ali, tell me what are the application scenarios of message middleware you know?
- (Crypto essential dry goods) Detailed analysis of the current NFT trading markets
- What is GameFi?
- 利用phpstudy搭建DVWA
猜你喜欢
随机推荐
小白学爬虫——爬虫入门
Artifact SSMwar exploded Error deploying artifact.See server log for details
了解SSRF,这一篇就足够了
[uiautomation] Get WeChat friend list (stored in txt)
12 【nextTick 过渡与动画】
通信原理——纠错编码 | 汉明码(海明码)手算详解
leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)
[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?
正则表达式基础知识
mac10.14中安装mysqldb
Understanding SSRF, this article is enough
【JVM加载】---类加载机制
碎片化NFT(Fractional NFT)
leetcode-每日一题735. 行星碰撞(栈模拟)
年终总结——岁月静好~
DeFi 项目中的治理Token
场效应管 | N-mos内部结构详解
The server time zone value ‘й‘ is unrecognized or represents more than one time zone
【云原生】SQL(及存储过程)跑得太慢怎么办?
C language tutorial (3) - if and loop