服务器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) 一. 问题描述 之前一直在服务上使用宝塔面板, 今天突发奇想, ...
随机推荐
- golang build error: syntax error: nested func not allowed
在笔记本中写了一个简易web程序,但是编译失败,提示“syntax error: nested func not allowed” . 不明白什么意思,幸好代码量小,原来是方法的末尾的“}”丢了! p ...
- django后台数据管理admin设置代码
新建admin用户 createsuperuser 设定好用户名,邮箱,密码 设置setting LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shangha ...
- 记录:正确率、召回率、F值
因为不理解召回率,所以去查看了一些资料.特此记录一下自己的理解,以便以后查看. 说明 正确率=查出来正确的样本数/全部查出来的样本数 (也可以理解为查准率) 召回率=查出来正确的样本数/数据集里全部正 ...
- 常用的系统架构 web服务器之iis,apache,tomcat三者之间的比较
常用的系统架构是: Linux + Apache + PHP + MySQL Linux + Apache + Java (WebSphere) + Oracle Windows Server 200 ...
- quick-cocos2d-x + Lua 开发
quick-cocos2d-x + Lua 开发 quick-cocos2d-x + Lua 开发 首页在Eclipse中搭建quick-cocos2d-x的lua开发环境. 1. 首先需要 ...
- ubuntu apt-get 安装 lnmp
最近在 Ubuntu 14.04 LTS 安装 LNMP 一键安装包的时候出现了问题,PHP 5 服务没有启动,只好使用 Ubuntu 官方源进行安装: Nginx (读音 “engine x”)免费 ...
- C++ char float int string 之间的转换
string str = "123"; string 转 int int i = atoi( str.c_str() ); string 转 float float f = ato ...
- OpenLDAP搭建全过程
目 的:搭建一套完整的OpenLDAP系统,实现账号的统一管理. 1:OpenLDAP服务端的搭建 2:P ...
- 设置小窗口Activity
http://blog.csdn.net/xieyihua1994/article/details/52586270 我们知道Activity本身是没有界面的.所以activity类创建了一个窗口,开 ...
- Elasticsearch、MongoDB、Hadoop适用场景
如果你仅仅想要通过关键字和简单的分析,那么Elasticsearch可以完成任务: 如果你需要查询文档,并且包含更加复杂的分析过程,那么MongoDB相当适合: 如果你有一个海量的数据,需要大量不同的 ...