Linux系统下SSH服务启动失败故障处理
生活随笔
收集整理的這篇文章主要介紹了
Linux系统下SSH服务启动失败故障处理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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 daemonLoaded: 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 agoDocs: 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 daemonLoaded: 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 agoDocs: man:sshd(8)man:sshd_config(5)Main PID: 22158 (sshd)Tasks: 1CGroup: /system.slice/sshd.service└─22158 /usr/sbin/sshd -DFeb 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]#總結
以上是生活随笔為你收集整理的Linux系统下SSH服务启动失败故障处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Docker容器之macvlan网络
- 下一篇: 数据备份和容灾技术