发生此次故障的原因:

  在文件夹授权时 错误的执行了 chmod -R 755 /

本来只想授权当前文件夹的 结果...

然后就导致xshell连不上了 懵逼...

解决方案 将权限收回:

执行: chmod -R 600 /etc/ssh/

重启: systemctl status sshd.service

以下是解决问题时的一些关键字:

[root@iZ2vcdtfg9o3j8bu9odeqyZ server]# systemctl restart sshd
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
[root@iZ2vcdtfg9o3j8bu9odeqyZ server]# systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-09-11 10:26:32 CST; 5s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 24730 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 24730 (code=exited, status=1/FAILURE)

Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: Permissions 0620 for '/etc/ssh/ssh_host_ed25519_key' are too open.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: It is required that your private key files are NOT accessible by others.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: This private key will be ignored.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: key_load_private: bad permissions
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24730]: sshd: no hostkeys available -- exiting.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: sshd.service: main process exited, code=exited, status=1/FAILURE
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: Failed to start OpenSSH server daemon.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: Unit sshd.service entered failed state.
Sep 11 10:26:32 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: sshd.service failed.
[root@iZ2vcdtfg9o3j8bu9odeqyZ server]# chmod -R 600 /etc/ssh/
[root@iZ2vcdtfg9o3j8bu9odeqyZ server]# systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-09-11 10:27:14 CST; 436ms ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 24735 (sshd)
CGroup: /system.slice/sshd.service
└─24735 /usr/sbin/sshd -D

Sep 11 10:27:14 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: Starting OpenSSH server daemon...
Sep 11 10:27:14 iZ2vcdtfg9o3j8bu9odeqyZ sshd[24735]: Server listening on 0.0.0.0 port 10022.
Sep 11 10:27:14 iZ2vcdtfg9o3j8bu9odeqyZ systemd[1]: Started OpenSSH server daemon.

connection closed by foreign host / Permissions 0620 for '/etc/ssh/ssh_host_ed25519_key' are too open 解决方案的更多相关文章

  1. 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 ...

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

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

  3. 关于xshell:Connection closed by foreign host

    因为原来系统网有时掉,有时卡(同局域网别人没事),重新做了系统. 装了xmanager3,在用xshell连接linux服务器时,提示:服务器发送了一个无效的密钥,然后输出:Connection cl ...

  4. telnet出现Connection closed by foreign host

    2018-10-26 执行命令: telnet smtp.exmail.qq.com 出现信息: [root@pengman Desktop]# telnet Tring Connected to 1 ...

  5. XShell 连接虚拟机中的服务器 失败 、连接中断(Connection closed by foreign host.)

    在使用XShell连接虚拟机中的服务器时,报以下错误并断开连接,之前连接还是挺稳定的,忽然就这样了 Last login: Thu Aug :: from 192.168.1.102 [root@no ...

  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. linux篇-xshell连接突然报Connection closed by foreign host.

    1问题描述报错 Connection closed by foreign host. Disconnected from remote host(yaoGS) at 155513. 2登入虚拟机 在l ...

  9. Connection closing...Socket close. Connection closed by foreign host. Disconnected from remote host(centos6.9) at 14:59:05.

    查找网上资料解决方法如下 [root@localhost ssh]# service sshd start Starting sshd: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ...

随机推荐

  1. 改了改之前那个很糙的XXX

    将就着用X度去爬吧 <?php echo "***************************************\r\n"; echo "* SubDom ...

  2. 未来京东真能成为中国第一大B2C电商平台吗?

    ​     2月10日,京东集团在北京举行2017年"科技引领未来"开年年会.在本届年会上,京东宣布全面向技术转型.京东集团CEO刘强东正式对外公布未来12年的战略:在以人工智能为 ...

  3. webpack 手动创建项目

    前言: webpack作为当前算是比较流行的打包工具之一,通过设置入口文件开始会把入口文件所依赖的所有文件(js,css,image等)进行对应的打包处理,其实现当时真的是很独特.现在流行的脚手架工具 ...

  4. Grafana使用总结

    最近工作需求学习了下grafana,根据创建的几个dashboard简要记录下创建过程. 本次使用了grafana做可视化展示,data source使用的rds是postgresql和时序数据库in ...

  5. go语言指南之切片练习

    题目: 实现 Pic.它应当返回一个长度为 dy 的切片,其中每个元素是一个长度为 dx,元素类型为 uint8 的切片.当你运行此程序时,它会将每个整数解释为灰度值(好吧,其实是蓝度值)并显示它所对 ...

  6. 深度学习遥感影像(哨兵2A/B)超分辨率

    这段时间,用到了哨兵影像,遇到了一个问题,就是哨兵影像,它的RGB/NIR波段是10米分辨率的,但是其他波段是20米和60米的,这就需要pansharpening了,所以我们需要设计一种算法来进行解决 ...

  7. Javascript元编程之Annotation

    语言的自由度 自由度这个概念在不同领域有不同的定义,我们借鉴数学中构成一个空间的维数来表达其自由度的做法,在此指的是:解决同一个问题彼此不相关的设计方法学数量. 例如,解决一个比如商品打折的问题,如何 ...

  8. 使用node打造自己的命令行

    一.实现一个简单的功能 二.环境 1.系统: window 10 2.编辑器: vscode 3.node版本: 8.7.0 三.开始玩 1.打开命令行,新建一个pa'ckage.json npm i ...

  9. 内存:你跑慢点行不行?CPU:跑慢点你养我吗?内存:我不管!(内附超全思维导图)

    主存(RAM) 是一件非常重要的资源,必须要认真对待内存.虽然目前大多数内存的增长速度要比 IBM 7094 要快的多,但是,程序大小的增长要比内存的增长还快很多.不管存储器有多大,程序大小的增长速度 ...

  10. Matplotlib数据可视化(5):柱状图与直方图

      柱状图和直方图是两种非常类似的统计图,区别在于: 直方图展示数据的分布,柱状图比较数据的大小. 直方图X轴为定量数据,柱状图X轴为分类数据.因此,直方图上的每个条形都是不可移动的,X轴上的区间是连 ...