服务器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) 一. 问题描述 之前一直在服务上使用宝塔面板, 今天突发奇想, ...
随机推荐
- Hibernate错误:Could not bind factory to JNDI
使用hibernate时,将hibernate.cfg.xml中 <session-factory name="SessionFactory">的那么属性去掉即可.因为 ...
- linxu系统压缩解压命令
使用cat命令进行文件的纵向合并 两种文件的纵向合并方法 归档文件和归档技术 归档的目的 什么是归档 tar命令的功能 tar命令的常用选项 使用tar命令创建.查看及抽取归档文件 使用tar命令创建 ...
- 微信小程序组件radio
表单组件radio:官方文档 Demo Code: Page({ data: { items: [ {name: 'USA', value: '美国'}, {name: 'CHN', value: ' ...
- [笔记]Delphi 2007写DLL供VC调用实例
考虑如下几种常用情况: - VC传入int,返回int- VC传入char *,返回int- VC传入char *,返回char *及int 为简化问题,传递的字符串参数只考虑ANSI格式,不考虑UN ...
- iOS 学习 RESTful 中 Http 的幂等性
一. RESTful RESTful (Representational State Transfer) 是一种常用流行的软件架构,设计风格或协议标准.提供了一组设计风格和约束条件.主要用于客户端和 ...
- ASP.NET Core EF 查询获取导航属性值,使用Include封装
// 引用 using Microsoft.EntityFrameworkCore; // 摘要: // Specifies related entities to include in the qu ...
- 论文笔记:OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks
2014 ICLR 纽约大学 LeCun团队 Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, Yann ...
- C++之旅(第一天)
基础知识 完全支持C语言 可以在C++引入C的头文件 #include <stdio.h> #include <iostream> int main() { } 输入和输出 C ...
- mysql外键约束无法删除数据的情况解决办法
先删除子表的数据,然后再删除主表的数据.
- PHP 日期格式中 Y与y
大写Y效果: $nowtime = time(); $nowtime=date("Y-m-d",$nowtime); 结果: 2015-10-24 小写y效果: $nowtime ...