您当前的位置: 首页 >  linux

江湖有缘

暂无认证

  • 0浏览

    0关注

    446博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Linux系统下SSH服务启动失败故障处理

江湖有缘 发布时间:2022-02-03 21:23:01 ,浏览量:0

Linux系统下SSH服务启动失败故障处理
  • 一、系统版本
  • 二、报错状态
  • 三、处理方法
  • 四、查看服务状态

一、系统版本
[root@localhost ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

二、报错状态
[root@localhost ~]# systemctl status sshd
● 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 Fri 2022-02-04 04:36:19 CST; 38s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 21131 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 21131 (code=exited, status=1/FAILURE)

Feb 04 04:36:19 localhost.localdomain sshd[21131]: Permissions 0640 for '/etc/ssh/ssh_host_ed25519_key' ...en.
Feb 04 04:36:19 localhost.localdomain sshd[21131]: It is required that your private key files are NOT ac...rs.
Feb 04 04:36:19 localhost.localdomain sshd[21131]: This private key will be ignored.
Feb 04 04:36:19 localhost.localdomain sshd[21131]: key_load_private: bad permissions
Feb 04 04:36:19 localhost.localdomain sshd[21131]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Feb 04 04:36:19 localhost.localdomain sshd[21131]: sshd: no hostkeys available -- exiting.
Feb 04 04:36:19 localhost.localdomain systemd[1]: sshd.service: main process exited, code=exited, status...URE
Feb 04 04:36:19 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon.
Feb 04 04:36:19 localhost.localdomain systemd[1]: Unit sshd.service entered failed state.
Feb 04 04:36:19 localhost.localdomain systemd[1]: sshd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

三、处理方法
[root@localhost ssh]#chmod 600 /etc/ssh/ssh_host_ed25519_key
[root@localhost ssh]# systemctl restart sshd

四、查看服务状态
[root@localhost ssh]# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-02-04 05:18:48 CST; 1min 39s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 22158 (sshd)
    Tasks: 1
   CGroup: /system.slice/sshd.service
           └─22158 /usr/sbin/sshd -D

Feb 04 05:18:48 localhost.localdomain sshd[22158]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Feb 04 05:18:48 localhost.localdomain sshd[22158]: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
Feb 04 05:18:48 localhost.localdomain sshd[22158]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Feb 04 05:18:48 localhost.localdomain sshd[22158]: Permissions 0640 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
Feb 04 05:18:48 localhost.localdomain sshd[22158]: It is required that your private key files are NOT accessible by others.
Feb 04 05:18:48 localhost.localdomain sshd[22158]: This private key will be ignored.
Feb 04 05:18:48 localhost.localdomain sshd[22158]: key_load_private: bad permissions
Feb 04 05:18:48 localhost.localdomain sshd[22158]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Feb 04 05:18:48 localhost.localdomain sshd[22158]: Server listening on :: port 22.
Feb 04 05:18:48 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
[root@localhost ssh]# 


关注
打赏
1665849170
查看更多评论
立即登录/注册

微信扫码登录

0.0395s