MobaXterm连接服务器:Network error: Connection refused

centos7:

问题:连接本地虚拟机时,连接不上,报错--Network error: Connection refused
原因:
1.刚开始直接ping主机,是可以ping通的,说明网络是正常的
[root@szb ~]# ping 192.168.8.132
PING 192.168.8.132 (192.168.8.132) 56(84) bytes of data.
64 bytes from 192.168.8.132: icmp_seq=1 ttl=64 time=0.969 ms
64 bytes from 192.168.8.132: icmp_seq=2 ttl=64 time=4.00 ms

2.查询sshd安装了没,说明是存在的
[ly@192 ~]$ ps -e |grep ssh
  8245 ?        00:00:00 ssh-agent
  
3.ss -ntl 查询22端口是否开启,此处没有22端口
[ly@192 ~]$ ss -ntl
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port         
LISTEN     0      5      192.168.122.1:53                       *:*                  
LISTEN     0      128    127.0.0.1:631                      *:*                  
LISTEN     0      128      [::1]:631                   [::]:*                  
解决办法:确认一下是否还是默认的端口,vim /etc/ssh/sshd_config,显示没有被修改

4.重启sshd服务,在查看端口,已经存在22端口了,MobaXterm软件重连接,可以了
systemctl restart sshd

ubuntu20.04

报错:root@192.168.8.141's password:
Access denied

排查路径:
1.查看sshd相关服务是否存在
apt-get install openssh-server
systemctl restart ssh     # 重启 openssh server

2.查看22端口是否存在
ss -ntl

3.将密码拒绝远程访问改一下配置
root@ubuntu:~# vim /etc/ssh/sshd_config 
#PermitRootLogin prohibit-password
改为
PermitRootLogin yes
systemctl restart ssh
  • 16
    点赞
  • 51
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值