sshd 無法啟動的解決辦法
發(fā)布時間:2025-01-11 15:10       
更新時間:2025-01-11 16:09
【Centos】sshd 無法啟動(解決問題篇)
問題:重啟sshd服務出現(xiàn)問題如下
[root@dwidc]#systemctl start sshd
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark,1) Job for sshd.service failed because the control process exited with error code. see "systemctl status sshd.service" and "journal ctl -xe" for details
[root@dwidc]#
解決思路和方法
用systemctl status sshd命令查看sshd的狀態(tài)
[root@dwidc]#systemclt status sshd
sshd.service -OpensSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating Cauto-restart) (Result: exit-code) since Sun 2024-09-05 09: 30: 18 CST: 12s agp
Docs:man:sshd(8)
man:sshd_config(5)
Process:13561 Execstart=/usr/sbin/sshd -D $OPTIONS(code=exited,status=1/FAILURE)
Main pid:13561(code=exited status=1/FAIlURE)
Sep 05 09:30:18 dwidc sshd[13561]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep 05 09:30:18 dwidc sshd[13561]: Permissions 0644 for '/etc/ssh/ssh_host_ed25519_key' are too open
Sep 05 09:30:18 dwidc sshd[13561]: It is required that your private key files are NoT accessible by others
Sep 05 09:30:18 dwidc sshd[13561]: This private key will be ignored
Sep 05 09:30:18 dwidc sshd[13561]: key_load_private: bad permissions
Sep 05 09:30:18 dwidc sshd[13561]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Sep 05 09:30:18 dwidc sshd[13561]: sshd: no hostkeys available -- exiting
Sep 05 09:30:18 dwidc systemd[1]: failed to start openSSH server daemon
Sep 05 09:30:18 dwidc systemd[1]: Unit sshd.service entered failed state
Sep 05 09:30:18 dwidc systemd[1]: sshd.service failed
[root@dwidc]#
發(fā)現(xiàn)有一句報錯是
Permissions 0644 for '/etc/ssh/ssh_host_ed25519_key' are too open
這句話說的是你的這個key文件的權(quán)限過高
我們把權(quán)限調(diào)整下
chmod 600 /etc/ssh/ssh_host_ed25519_key
最后再用sshd -t 檢查一下,發(fā)現(xiàn)沒有問題。查看sshd的服務狀態(tài)正常運行。