ssh问题:ssh_exchange_identification: Connection closed by remote host...

刚刚一个朋友告诉我SSH连接不上服务器了,重启电脑也不管用.我仔细看了一下,老报如下错误:

ssh_exchange_identification: Connection closed by remote host

the connection to the remote host was lost . this usually means that you network connection went down or that the remote host was rebooted most network outages are short. and thus trying again may work

(1)  最简单的解决方法就是让/etc/hosts.allow 和/etc/hosts.deny里面的所有信息都不生效,全部注销掉,重启SSH服务就可以了.

但是,有时候在你修改后不久,仍然会出现/etc/hosts.deny自动修改,让你还是登录不了,此时需要检查denyhosts服务。

在redhat系列的版本中,有一个denyhosts服务,会自动覆盖/etc/hosts.deny文件,在确认要登录的机器没有问题时,可以简单做如下处理:

/etc/init.d/denyhosts stop

vim /etc/hosts.allow文件,加入 sshd:ALL。

(2)  但是还有一种情况,就是客户端连接数过多时,也会报这个错误。缺省情况下,SSH终端连接数最大为10个。在这种情况下,需要改SSH的配置文件,

解决方案:

1)        修改/etc/ssh/sshd_config中#MaxStartups 10,将其改为MaxStartups 1000

2)        重启SSH服务,/etc/init.d/ssh restart

ssh问题:ssh_exchange_identification: Connection closed by remote host的更多相关文章

  1. 【Ansible】SSH Error: ssh_exchange_identification: Connection closed by remote host

    ansible ssh到目标机器 时好时坏,报错:  SSH Error: ssh_exchange_identification: Connection closed by remote host ...

  2. ssh_exchange_identification: Connection closed by remote host

    用服务器内网ip连接同子网服务器的时候显示ssh_exchange_identification: Connection closed by remote host 防火墙什么都关闭了,还是显示这个问 ...

  3. ssh连接提示 "Connection closed by remote host"

    如果原来是可以用ssh连接的, 突然连接不上通常是连接数过多导致的. 解决方法一. 把SSH连接数改大 修改服务器上的这个文件:/etc/ssh/sshd_config 找到这行: # MaxSess ...

  4. sftp修改用户home目录后登录时报connection closed by remote host

    在sftp用户需要修改登录根目录的情况下,我们可以修改/etc/ssh/sshd_config文件中ChrootDirectory /home/[path]的路径. 但是,在重启sshd服务后,sft ...

  5. ssh 连接不上报Connection closed by remote host

    解决办法 (1)查看这两个文件是否有阻止cat /etc/hosts.deny cat /etc/hosts.allow (2)客户端连接数过多修改/etc/ssh/sshd_config中#MaxS ...

  6. xshell连接不了虚拟机处理方法(错误提示:Connection closing...Socket close.Connection closed by foreign host.Disconnected from remote host(localhost) at 08:47:23.)

    一.问题描述:xshell连接不了虚拟机,出现错误提示:Connection closing...Socket close.Connection closed by foreign host.Disc ...

  7. 解决 SSH Connection closed by foreign host 问题

    Xshell 报错 : 1.有可能是IP和别人冲突,改一下IP就好了 2.也有可能是文件权限的问题.改一下: cd /etc/ssh/ chmod ssh_host_* chmod *.pub 3.也 ...

  8. XShell提示Connection closed by foreign host的问题 和 路由器分配IP的规则

    情况是这样的: VMware中有三个Linux机器分别是crxy99(192.168.1.99),crxy100(192.168.1.100),crxy101(192.168.1.101),crxy1 ...

  9. Escape character is '^]'. Connection closed by foreign host.

    今天在用易汇金的接口回调时候,老是回调不到我的机器上面.我的ip通过公网映射,按说是可以访问到我的ip,思考是什么问题. 1.防火墙关闭,不行 2.防火墙开启,但是把自己的端口号改为可以访问(参考:h ...

随机推荐

  1. python连接RabbitMQ

    安装PIP wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz tar -xzvf pip-.tar.g ...

  2. .NET C#获取当前网页地址

    摘自:https://www.cnblogs.com/vichin/p/6004249.html 设当前页完整地址是:http://www.jb51.net/aaa/bbb.aspx?id=5& ...

  3. 关于QTcreator出现不能包含头文件的解决

    调试出现不能包含“某某.h文件”当增加次文件时候,还会出现另一个不能包含“某某.h”文件. 问题解决:由于VS2015和QT的冲突导致(不完全),下载不关联VS的QT版本再进行安装就可以啦.

  4. cat & 文件结束符

    语法: 连接显示 选项: -n,显示行号. -v,显示不可见打印符. -E,显示“行结束符”($). 显示行号 $ cat -n /etc/fstab /dev/VolGroup00/LogVol00 ...

  5. python对象序列化pickle

    import pickle class A: users = {} c = 1 def get_self(self): return self def n(self): return 1 def pi ...

  6. linux环境下Mysql的卸载和重新安装和启动

    MySql安装 1 安装包准备 1.查看mysql是否安装,如果安装了,卸载mysql (1)查看 [root@hadoop102 桌面]# rpm -qa|grep mysqlmysql-libs- ...

  7. anchor values list

  8. socket-tcp

    server import socketip_port=('127.0.0.1',8080);back_log=5buffer_size=1024 serv=socket.socket(socket. ...

  9. 安装 docker管理 工具 页面 portainer

    sudo docker run -d -p 7998:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data ...

  10. 【转】Jenkins 二次开发 - Python

    马克,备用: Jenkins 二次开发 https://testerhome.com/topics/14988?locale=zh-TW python-jenkins api 文档:https://p ...