Linux network settings 3-ssh tool usage Note 1. ssh tool usage principle ssh (SecureShellClient) is installed on windows, while on linux There is a service called sshd, this service occupies port 22, which is started by default. However, port 22 is not trusted by default and must be set manually. This explains the problems encountered in using ssh. Question 1: windows and linux can be pinged, but the ssh tool cannot connect. Answer 1: Because the ping address directly finds port 80, rather than port 22, ping the port 22 may fail.
Question 2: netstat-anp | more found that sshd is started, but the ssh tool cannot connect. Answer 2: port 22 is blocked by the firewall. 2. Solution to connection failure Using ssh tools. 1. Solve sshd service problems. ps aux | grep ssh check whether ssh is enabled, or netstat-anp | more to check whether port 22 is listening. If it is not started, you can enter the service to start sshd or run the sudo ssh start command. If this service is not reported, it indicates that ssh is not installed and openssh is installed. Method 2: Open the/etc/sysconfig/iptables file of port 22 and enter the command vi/etc/sysconfig/iptables, add-A XXXXXXX-INPUT-p tcp-m tcp -- dport 22 -- syn-j ACCEPT to open port 22. Of course, when installing Linux, you can set the sshd service as trusted when setting the firewall. Iii. Knowledge about Linux Firewall 1. It takes effect permanently and will not be enabled after restart: chkconfig iptables on Disabled: chkconfig iptables off 2 takes effect immediately. After restart, it is enabled: service iptables start disabled: the service iptables stop command must be used to enable or disable other services in Linux.