Linux SSH Remote Management Troubleshooting Solutions
SSH remote management troubleshooting solution:
1. Check whether the two machines are unblocked
Check whether the two machines are unblocked, and check whether there is a problem with the physical link ( if the network cable, network card, and IP are correct )
Step 1 : Whether the physical link is unblocked, analogous to " whether the highway is unblocked "
Ping is used to check the line between the client and the server. Ping is a commonly used network connectivity check tool.
tracert -d route trace command, -d is not reverse parsing
C:\Users\Administrator>ping 10.0.0.8
Pinging 10.0.0.8 with 32 bytes of data :
Reply from 10.0.0.8 : bytes = 32 time < 1ms
Reply from 10.0.0.8 : bytes = 32 time < 1ms
Reply from 10.0.0.8 : bytes = 32 time < 1ms
Reply from 10.0.0.8 : bytes = 32 time < 1ms
Ping stats for 10.0.0.8 :
Packets : Sent = 4 , Received = 4 , Lost
Estimated time of round trip in milliseconds :
Shortest = 0ms , Longest = 0ms , Average = 0ms
C:\Users\Administrator>tracert -d 10.0.0.8
Trace route to 10.0.0.8 over up to 30 hops
1 < 1 ms < 1 ms < 1 ms 10.0.0.8
Tracking is complete.
2. Is the .SSH service good ?
Step 2 : Is there a problem with the SSH service, analogous to " Is the tourist attraction open ?"
#/etc/init.d/sshd status Check whether the SSH service is enabled
Telnet 10.0.0.8 22 determines whether the default port 22 of the SSH server is open
[root@moban ~]# /etc/init.d/sshd status
openssh-daemon (pid 1601) is running...
[root@moban ~]#
Microsoft Windows [ Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation . all rights reserved.
C:\Users\Administrator>telnet 10.0.0.8 22
SSH-2.0-OpenSSH_5.3
If you enter the telnet prompt in the cmd window of windows : ..... not an internal or external command, nor an executable program ....
Solution: Start - Control Panel - Programs and Features - Turn Windows Features On or Off - Check Telnet Client - OK
3. Check whether the firewall is blocking
第3步:是不是防火墙阻挡,即是不是下雪封路,高度阻碍通行了
#/etc/init.d/iptables status:查看防火墙
#/etc/init.d/iptables stop:临时关闭防火墙Linux防火墙iptables可能好心办坏事,阻碍远程连接,所以如果防火墙开启则应关闭
[root@moban ~]# /etc/init.d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
Num target prot opt source destination
1 ACCEPT all --0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp --0.0.0.0/0 0.0.0.0/0
3 ACCEPT all --0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp --0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all --0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
Num target prot opt source destination
1 REJECT all --0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
Num target prot opt source destination
[root@moban ~]# /etc/init.d/iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@moban ~]#