Linux远程连接Linux故障排查思路

 1·检查服务端:网卡·IP是不是启动和正确的

ip add或者ifconfig

2·检查服务端:端口和进程

查端口:ss -lntup| netstnt -lntup

查进程:ps -ef|grep ssh

想让他提供服务

systemctl start sshd 在检查。

3·客户端:IP·端口·协议是不是对的。

都是对的,就是连不上,咋办那?

 A、ping 10.0.0.200 检查物理连接能否到达。
 [c:~]$ ping 10.0.0.200
 正在 Ping 10.0.0.200 具有 32 字节的数据:
 来自 10.0.0.200 的回复: 字节=32 时间=2ms TTL=64
 来自 10.0.0.200 的回复: 字节=32 时间<1ms TTL=64
 如果不可达:1、连接的IP输入错了。2、物理链路有问题(VM环境调虚拟网络编辑器)
  B、telnet 10.0.0.200 22 检查对方有没有提供服务,开启服务。
 [c:~]$ telnet 10.0.0.200 22
 Connecting to 10.0.0.200:22...
 Connection established.
 To escape to local shell, press 'Ctrl+Alt+]'.
 SSH-2.0-OpenSSH_7.4
 连不上的状态:
 [c:~]$ telnet 10.0.0.200 333

  Connecting to 10.0.0.200:333...

 1、服务端今天休息,没有提供服务(在此不成立)。2、防火墙(6是iptables,7是firewalld)。
 查看状态:systemctl status firewalld.service
    #active (running)活着的状态
 #Active: inactive (dead) 死的状态。
 关闭:systemctl stop firewalld.service
 启动:systemctl start firewalld.service
 开机不自动启动:systemctl disable firewalld.service

原文地址:https://www.cnblogs.com/zhaoqing4191713/p/10477694.html