Note: I am using the Centos6.8 version. Centos7 the Linux commands in the above version will be different.
Start the Xshell terminal to connect to the server: using the command: SSH + IP address or manually using the Visual Action window,
Problem 1:could not connect to ' 10.23.57.227 ' (Port 22)
One: Firewall turned off:
1. Permanent entry into force
Open: Chkconfig iptables on
OFF: Chkconfig iptables off
2. Immediate effect, failure after reboot
Open: Service iptables start
Close: Service iptables stop
two: Ssh-server server turned off:
Enable SSH service: Service sshd start
Turn off SSH service: Service sshd stop
Restart SSH service: Servcie sshd restart
SSH service boot automatically: Chkconfigsshd on
Cancel power-On self-boot: chkconfig sshd off
After the service is turned on, check the status: Service sshd status
Summary: Firewalls and SSH service commands are almost the same.
Third: The ping + IP when there is an exception connect network unreachable
Using Ifconfig to find the IP address is not found, and do not know what the reason, the Manual input command set up an IP:
[email protected] Desktop]# ifconfigeth0 Link encap:ethernet HWaddrxx: 0C: in: c2:1b: toInet6 addr:fe80::20c:29ff:fec2:1b05/ -scope:link up broadcast RUNNING multicast MTU: theMetric:1RX Packets:960Errors0Dropped0Overruns:0Frame0TX Packets:739Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen: +RX Bytes:725542(708.5KiB) TX Bytes:71499(69.8KiB) Lo Link encap:local Loopback inet addr:127.0.0.1Mask:255.0.0.0Inet6 Addr: ::1/ -scope:host up LOOPBACK RUNNING MTU:65536Metric:1RX Packets:812Errors0Dropped0Overruns:0Frame0TX Packets:812Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen:0RX Bytes:79634(77.7KiB) TX Bytes:79634(77.7KiB)
The command is:
10.23. 57.227 255.255. 255.0
Again ifconfig get:
[email protected] Desktop]# ifconfigeth0 Link encap:ethernet HWaddrxx: 0C: in: c2:1b: toinet addr:10.23.57.227 bcast:10.23.57.255 mask:255.255.255.0Inet6 addr:fe80::20c:29ff:fec2:1b05/ -scope:link up broadcast RUNNING multicast MTU: theMetric:1RX Packets:960Errors0Dropped0Overruns:0Frame0TX Packets:739Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen: +RX Bytes:725542(708.5KiB) TX Bytes:71499(69.8KiB) Lo Link encap:local Loopback inet addr:127.0.0.1Mask:255.0.0.0Inet6 Addr: ::1/ -scope:host up LOOPBACK RUNNING MTU:65536Metric:1RX Packets:812Errors0Dropped0Overruns:0Frame0TX Packets:812Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen:0
can ping through ...
IV: How to uninstall the CentOS system comes with SSH
Yum Remove openssh-clients
Yum Remove Openssh-server
Summary: I found all of the above port numbers occupy the problem. Firewall problem, there is no error when and re-uninstall the installation of SSH service, still can't fight to solve the problem, and then reinstall a virtual host,
Input Ifcong, found that its IP address is a randomly assigned IP address, but in a network segment, and I was in the first virtual host set the IP address is self-set and with my local window host network connection
The IP "" address, can not be the same, so modified to 226 successful access, it is really egg pain ah ... Oneself to dig a big hole for oneself, but at the same time warm so know new, more familiar with Linux related knowledge.
Xshell connection to Linux (centos6.8) failed solution