服务器22端口连接超时 ssh: connect to host *** port 22: Operation timed out
最近酸酸乳出问题,连接v社服务器发现碰到
ssh: connect to host master port 22: Connection timed out
的问题。现在对该问题做一下可能出现的问题
的总结和解决办法:
一.IP配置错误。
当出现上述错误时,首先检查网络连通情况,Ping一下远程登录的目标主机,如果ping不通,很有可能
是/etc/hosts文件中的IP地址映射出现问题,需要仔细检查名称和IP地址的映射关系。
二.防火墙问题。
当发现IP配置没有错误时,我们需要检查端口是否被防火墙禁用了,使用
sudo service iptables status
命令查看防火墙状态,如果出现:
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080
2 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
3 DROP tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
我们可以看到,ssh登陆的默认端口22被禁止了。
我们使用
sudo chkconfig iptables off
来永久关闭防火墙,如果使用
sudo service iptables stop
将临时关闭防火墙,会在下一次关机重启后重置,建议使用第一种。
实在不行试试这个:
vi /etc/ssh/sshd_config: 两项注释号掉 Port 22 Protocol 2
如果真的不行那恭喜你,你的服务器被qiang了
服务器22端口连接超时 ssh: connect to host *** port 22: Operation timed out的更多相关文章
- ssh: connect to host port 22: Connection refused
配置Linux的互信,互信完成后,连接需要+端口才可以已经将端口修改为7777,但依旧走的是默认的22端口修改方式:[root@yoon ssh]# vi /etc/servicesssh ...
- github默认端口22被占用,ssh: connect to host github.com port 22: Connection timed out
出现github 连接错误: ssh:connect to host github.com port 22:Connection timed out 刚开始以为是网络问题,github不能连接上,但是 ...
- ssh: connect to host github.com port 22: Connection timed out
问题描述 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git Cloning into 'MaugerWu.github.io'... ...
- Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误
在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...
- 阿里云配置通用服务的坑 ssh: connect to host 47.103.101.102 port 22: Connection refused
1.~ wjw$ ssh root@47.103.101.102 ssh: connect to host 47.103.101.102 port 22: Connection refused ssh ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- Linux(例如CentOS 7)打开TCP 22端口,基于SSH协议
SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定:SSH 为建立在应用层和传输层基础上的安全协议.SSH 是目前较可靠,专 ...
- github连接报"ssh: connect to host github.com port 22: Connection timed out"错误
1. 异常 在连接github时,执行"ssh -T git@github.com" 命令时,出现 ssh: connect to host github.com port 22: ...
- ssh本机失败(ssh: connect to host localhost port 22: Connection refused)
ssh本机失败(ssh: connect to host localhost port 22: Connection refused) 一. 问题描述 之前一直在服务上使用宝塔面板, 今天突发奇想, ...
随机推荐
- 生信-RPKM与FPKM学习[转载]
转自:https://baike.baidu.com/item/RPKM/1197657 均反应基因的表达水平 1.RPKM的计算公式 分母是总共比对到这个基因的reads的数目(条 为单位),分母是 ...
- 聊一聊python的单例模式
单例模式 单例模式(Singleton Pattern)是一种常用的软件设计模式,该模式的主要目的是确保某一个类只有一个实例存在.当你希望在整个系统中,某个类只能出现一个实例时,单例对象就能派上用场. ...
- 在debian9上安装mongodb
MongoDB是一个免费的开源NoSQL文档数据库,在现代Web应用程序中常用.在本教程中,您将安装MongoDB,管理其服务,并可选择启用远程访问.要遵循这个...... 介绍 MongoDB是一个 ...
- PKU 2506 Tiling(递推+高精度||string应用)
题目大意:原题链接有2×1和2×2两种规格的地板,现要拼2×n的形状,共有多少种情况,首先要做这道题目要先对递推有一定的了解.解题思路:1.假设我们已经铺好了2×(n-1)的情形,则要铺到2×n则只能 ...
- 『NiFi 学习之路』简介
『NiFi 学习之路』简介 『NiFi 学习之路』入门 -- 下载.安装与简单使用 『NiFi 学习之路』资源 -- 资料汇总 『NiFi 学习之路』把握 -- 架构及主要组件 『NiFi 学习之路』 ...
- Codeforces Round #408 (Div. 2) D - Police Stations
地址:http://codeforces.com/contest/796/problem/D 题目: D. Police Stations time limit per test 2 seconds ...
- Docker+.Net Core 的那些事儿-1.准备工作
1.下载centos 地址:https://www.centos.org/download/ 我使用的是DVD ISO,这么做的目的是为了在之后的docker填坑的路上,方便使用centos中Fire ...
- C#小票打印机动态纸张尺寸
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 【Python】闭包 & 匿名函数
闭包 1.注意:返回的函数内部不要使用后续会发生变化的变量. def f(): gs = [] for k in range(1, 4): def g(i): return i + k gs.appe ...
- xxxx interview
1. 什么数据库,做了什么优化? 回答mysql innodb与myisam区别,根据业务选择引擎.事务,行级锁,全文检索,二级索引. 存储:myisam数据和索引分开存储.innodb数据和索引存储 ...