在 MobaXterm 连接 Ubuntu Desktop 时提示 “Network error: Connection refused”,表示客户端无法与目标主机的 SSH 服务端口建立连接。以下是详细的排查和解决方法:
1.检查linux系统中是否安装了ssh服务,在终端中输入下面命令:
sudo systemctl status ssh
若返回Unit ssh.service could not be found,则说明需要安装该服务。
2.安装ssh服务,在终端中输入下面两条指令:
sudo apt update
sudo apt install openssh-server
3.验证 SSH 服务名称
sudo systemctl status sshdsystemctl list-unit-files | grep -i ssh
4.启动并启用 SSH 服务
# 启动服务
sudo systemctl start ssh# 设置开机自启
sudo systemctl enable ssh# 验证状态
sudo systemctl status ssh
5. 重启系统
sudo reboot
8020

被折叠的 条评论
为什么被折叠?



