问题1:
解决方案:
编辑/etc/ssh/sshd_config
文件,找到#UseDNS yes
行,取消注释并改为UseDNS no
,保存后执行systemctl restart sshd.service
重启服务
- 重启遇到的问题:
重启服务的时候可能报错sudo systemctl status sshd Failed to get properties: Connection timed out
- 原因:
当系统初始化进程(PID 1)被意外终止时,所有依赖systemd的管理命令(如systemctl status
)会因D-Bus通信失效而超时。典型表现为systemctl status systemd
命令同样失败,且系统运行时间较长(如超过30天)1。此时需强制重启恢复
- 解决方案:
使用强制重启命令:sudo reboot -f
重启linux系统之后,该系统上面的所有服务都要手动重启