我在linux中是新的,但在Centos中是最新的。
使用CentOS版本6.6 (最终版本)
我可以通过service sshd start启动ssh服务并获得这个输出。
Generating SSH2 RSA host key: [ OK ]
Generating SSH1 RSA host key: [ OK ]
Generating SSH2 DSA host key: [ OK ]
Starting sshd: [ OK ]并可通过ssh连接后无问题。
但是我需要通过/usr/sbin/sshd -D启动ssh并获得这个输出
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key服务还没有开始。
发布于 2014-12-11 21:53:36
我怀疑您正在尝试使用非根用户启动sshd应用程序。
主机密钥文件的权限仅允许根用户读取它们。
4 -rw-r--r--. 1 root root 2047 Nov 6 09:07 ssh_config
4 -rw-------. 1 root root 3879 Nov 6 09:07 sshd_config
4 -rw-------. 1 root root 672 Jun 23 13:32 ssh_host_dsa_key
4 -rw-------. 1 root root 963 Jun 23 13:32 ssh_host_key
4 -rw-------. 1 root root 1675 Jun 23 13:32 ssh_host_rsa_key在CentOS6中,selinux可以阻止一些操作,因此您可能需要查看:
/var/log/audit/audit.log 我希望这能帮到你。
https://serverfault.com/questions/651982
复制相似问题