Methods/steps
This requires the Linux server to support nc commands. If it is not installed, it will be displayed as follows.
We can install it directly with yum command. Mine is Centos6.5 system.
If not, directly typing the nc command will display the hair of its user.
If you need to test whether the port of a server can be accessed normally outside.
For example, I will test whether port 80 of IP 180.97.33. 107 can use this command.
NC-z-w 1 180 . 97 . 33 . 10780
You can see that TCP is used for testing by default. If you want to test whether the UDP port is open, you can add -u to use it together. For example, I will test UDP53 port of 202.96. 128.86 IP.
NC-u-z-w 1202 . 96 . 128.8653
You can see that the successful port will display relevant information, but if it is tested that the port is not open or blocked by a firewall, it will not return relevant information.
How to check which ports are located in listening state under Linux?
Use the netstst command to view the ports in listening state:
1, netstat-nupl//n/n indicates that the port number is displayed in digital form, u indicates the UDP protocol type, p indicates the program PID, and l indicates that it is in listening state;
2.netstat-nuplf|grep3306// This means that the process with port number 3306 is located in listening state.
How does linux know whether the port has been modified successfully?
Linux has modified the port, so it can be used to start related services and test the connectivity of the port.
Execute nmap-ST101.200.188.5438+038-P80.
Change the IP of101.200.188.138 to service, and change the port No.80 to the modified port, so that the TCP type port can be tested.
How to open port 80 under linux?
The specific operation steps are as follows:
1. First, open the terminal of linux, enter the instruction "vi/etc/sysconfig/iptables" in it, open the configuration file of iptables, and add a line "-a input-mstate-state new-mtcp-ptcp-d port 80-j accept".
2. Then restart iptables and enter "serviceiptablesrestart" to restart the service.
3. After the restart is successful, enter "serviceiptablesstatus" and press Enter to display the effective rules.
4. Finally, we can test whether it is successful. The most direct way is to use cm (command prompt window) and use telnet command to test. The command "telnet+ space+server IP+ space +80" can connect and you will jump directly to a blank window.
5. After the connection, the homepage of the server will pop up, indicating that port 80 has been successfully opened.
How to view linux open ssh port?
See linux open ssh port specific steps are as follows:
1. First check whether the SSH package has been installed in linux, and use rpm-QA | grepsash.
2. Confirm that the ssh service has been started. Take centos system as an example.
3. The path to find the SSh service configuration file is usually the file sshd_config in the /etc/ssh directory. Note: SSH port defaults to 22. If you want to modify, edit port 22 directly. Please note that the preceding "#" should be deleted, then saved and restarted.