【Centos】sshd 无法启动 问题解决
2022-07-14 本文已影响0人
无味wy
启动报错
[root@VM-0-16-centos /]# 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@VM-0-16-centos /]#
用systemctl status sshd. service命令查看sshd的状态
[root@VM-0-16-centos /]#systemclt status sshd.service
● 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 2021-89-05 09: 30: 18 CST: 12s ago
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 85 89: 30: 18 VM-8-16-centos sshd[13561]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep B5 89: 30: 18 VM-9-16-centos sshd[13561]: Permissions 8644 for/etc/ssh/ssh_host_ed25519_key‘are too open
Sep 05 89: 30: 18 VM-0-16-centos sshd[13561]:It is required that your private key files are NoT accessible by others
Sep 05 89: 30: 18 VM-0-16-centos sshd[13561]: This private key will be ignored
Sep 85 89: 30: 18 UM-0-16-centos sshd[13561]: key_load_private: bad permissions
Sep 05 89: 30: 18 UM-0-16-centos sshd[13561]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Sep 05 89: 30: 18 VM-8-16-centos sshd[13561]: sshd: no hostkeys available -- exiting
Sep 05 89: 30: 18 UM-0-16-centos system[1]: Failed to start OpenSSH server daemon
Sep 05 89: 30: 18 UM-0-16-centos systemd[1]: Unit sshd.service entered failed state
Sep 05 89: 36: 18 UM-0-16-centos systemd[1]: sshd.service failed
[root@VM-0-16-centos /]#
发现有报错是
Permissions 0644 for '/etc/ssh/ssh_host_ed25519_key' are too open
#这句话就是说的是你的这个key文件的权限过高
调整权限
chmod 600 /etc/ssh/ssh_host_ed25519_key
再然后用sshd -t检查一下,结果发现还有错,这次是说了/etc/ssh/ssh_host_rsa_key这个文件的权限过高
调整权限
chmod 600 /etc/ssh/etc/ssh/ssh_host_rsa_key
最后再用sshd -t检查一下,发现没有问题,查看sshd的服务状态。正常运行。问题解决