运行/usr/sbin/sshd
产生以下结果:
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
Missing privilege separation directory: /var/run/sshd
我检查了/etc/ssh
一下,发现所有 4 个主机密钥(及其.pub
文件)似乎都可用,尽管/var/run/sshd
有所丢失。
我该怎么做才能让它加载主机密钥?
答案1
使用以下命令运行sudo
:
sudo /usr/sbin/sshd
如果仍然收到权限分离目录错误:
sudo mkdir /var/run/sshd && sudo chmod -R 755 /var/run/sshd