Port number 1. View port number
- Use
netstat -anp to see those ports being opened. The add parameter '-n ' will convert the application to port display, that is, the address of the number format, such as: nfs->2049, ftp->21, so you can open two terminals, one for each corresponding to the port number of the program
lsof -i:$PORTView the program that applies the port (the $PORT corresponding port number). Or you can view the file /etc/services , from which you can find the service that corresponds to the port.
2. Close the port
- To disable the port through the Iptables tool, such as:
sudo iptables-a input-p tcp--dport $PORT-< Span style= "color: #000000;" >j drop sudo iptables-a output-p tcp--dport $PORT-j DROP
- or When the corresponding application is closed, the port naturally shuts down, such as:
kill-9 pid (PID: Process number) via NETSTAT-ANP | grep ssh There is a display: TCP 0 127.0 . 0.1 : 2121 0.0 . 0.0 :* LISTEN 7546 /ssh kill -9 7546
Version number 1. Kernel version
cat /proc/uname -uname -R
2. System version
[Email protected] ~]# lsb_release-cat /etc/cat /etc/redhat-release
3. Number of system bits
[[email protected] ~]# getconf long_bit #或者 [[email protected] ~]# getconf word_bit[[email protected] ~]# file /bin/ls [[email protected] ~]# lsb_release-a