zoukankan      html  css  js  c++  java
  • connection closed by foreign host / Permissions 0620 for '/etc/ssh/ssh_host_ed25519_key' are too open 解决方案

    发生此次故障的原因:

      在文件夹授权时 错误的执行了 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.

  • 相关阅读:
    【记录】【MySQL】填充字符串函数 LPAD(str,len,padstr)
    nvm安装node和npm,个人踩坑记录
    win10系统下cmd输入一下安装的软件命令提示拒绝访问解决办法
    bootstrap大图轮播手机端不能手指滑动解决办法
    JS中函数声明与函数表达式的异同
    javaScript实现归并排序
    js插入节点appendChild和insertBefore
    JS的事件冒泡和事件捕获
    js 停止事件冒泡 阻止浏览器的默认行为
    事件绑定的几种常见方式
  • 原文地址:https://www.cnblogs.com/AmbitiousMice/p/11504850.html
Copyright © 2011-2022 走看看