ssh故障排查

1、远程ssh连接ubuntu失败?

The remote system refused the connection.

原因分析:sshd启动失败

systemd[1]: Starting OpenBSD Secure Shell server...
sshd[19621]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
sshd[19621]: Missing privilege separation directory: /var/run/sshd
systemd[1]: ssh.service: failed with result "exit-code".
systemd[1]: Failed to start OpenBSD Secure Shell server.
systemd[1]: ssh.service: Unit entered failed state.
systemd[1]: ssh.service: Failed with result 'exit-code'

解决方法:

ssh-keygen -A
mkdir -p /var/run/sshd
systemctl restart sshd

posted on 2021-10-09 09:31  chalon  阅读(1363)  评论(0编辑  收藏  举报