问题描述:
以前一直能够通过Xshell来连接服务器,但是突然连接不上了.
解决思路:
首先通过命令查看SSH服务的状态:
systemctl status sshd
可以看到,有错误,但是没有显示详细信息:![[CentOS]Failed to start OpenSSH server daemon [CentOS]Failed to start OpenSSH server daemon](http://code.bmoook.com/wp-content/uploads/2023/03/20230310220807-640baa473a78f.jpg)
使用命令,定位错误详细信息
sshd -t
可以看到是因为没有/var/empty/sshd这个目录![[CentOS]Failed to start OpenSSH server daemon [CentOS]Failed to start OpenSSH server daemon](http://code.bmoook.com/wp-content/uploads/2023/03/20230310220811-640baa4ba760c.jpg)
使用命令创建相关目录,然后重新启动sshd服务即可.
问题描述:
以前一直能够通过Xshell来连接服务器,但是突然连接不上了.
解决思路:
首先通过命令查看SSH服务的状态:
systemctl status sshd
可以看到,有错误,但是没有显示详细信息:![[CentOS]Failed to start OpenSSH server daemon [CentOS]Failed to start OpenSSH server daemon](http://code.bmoook.com/wp-content/uploads/2023/03/20230310220807-640baa473a78f.jpg)
使用命令,定位错误详细信息
sshd -t
可以看到是因为没有/var/empty/sshd这个目录![[CentOS]Failed to start OpenSSH server daemon [CentOS]Failed to start OpenSSH server daemon](http://code.bmoook.com/wp-content/uploads/2023/03/20230310220811-640baa4ba760c.jpg)
使用命令创建相关目录,然后重新启动sshd服务即可.