Current location - Quotes Website - Collection of slogans - Linux open ports
Linux open ports
What are the commands of linux open port?

First, check which ports netstat-anp has opened. Second, close the port number: iptables-a input-ptcp-drop port number -jdropptitables-aoutput-ptcp-dport port number-jdrop. Third, open the port number: iptables-a input-ptcp-dport port number -jACCEPT. Four, the following is the use of linux open port command. Nc-lp23 (open port 23, telnet)netstat-an|grep23 (check whether to open port 23) V. linux open port command Each open port needs a corresponding listener.

Linux view available ports?

The port number of service port in TCP/IP protocol ranges from 0 to 65535, but it is limited in Linux. Generally, the port range of local TCP/UDP is defined in/proc/sys/net/IPv4/IP _ local _ port _ range. You can define net. Ipv4.ip _ local _ port _ range =102465000 in /etc/sysctl.conf, and the available port range becomes 1024~65000.

How do Linux servers open ports and configure firewalls?

Open the configuration file

Instruction code

#vi/etc/sysconfig/iptables

Correct configuration file

Configuration code

# firewall configurationwrittenbysystem-config-firewall

# manualizationofthisfileisnotrecommended。

* Filter

: Enter Accept

: Forward acceptance

: output accept

-ain put-mstate _ state established,RELATED-jACCEPT

-AINPUT-picmp-jACCEPT

-AINPUT-ilo-jACCEPT

-ain put-mstate _ state new-mtcp-ptcp _ d port 22-j cept

-ain put-mstate _ state new-mtcp-ptcp _ d port 80-j cept

-ainput-jreject _ reject-with icmp-host-forbidden

-a forward-j reject _ reject-with icmp-host-forbidden

commit a crime

Configure wildcard codes

-ain put-mstate _ state new-mtcp-ptcp _ dport *-JAC cept

Note: The newly opened port must be after port 22.

Restart the firewall for the configuration to take effect.

Instruction code

#/etc/init.d/iptablesrestart

other

View open ports

Instruction code

#/etc/init.d/iptablesstatus

Turn off the firewall

Instruction code

#/etc/init.d/iptablesstop

Can't port 3389 be opened successfully under linux?

Port 3389 is the default port for remote service under windows, but there is no such service under Linux, so this port cannot be opened successfully.

X 1 1vnc can be used remotely under Linux, which allows people to remotely view and control the real X display (that is, the display corresponding to the physical display, keyboard and mouse) with any VNCviewer.

If you don't need a remote desktop, you can also connect to the remote system of Linux through ssh.

Which ports does Yum open?

Command 1 netstat-a View all service ports Command 2 nmap+ip address yuminstallnmap Install nmap package linux open service port settings/etc/sysconfig/iptablesviiptables Add the following -a Enter -PTCP-MTCP-d port 600 1 -j cept then saves and exits, and restarts the service /etc/init.d/iptables restaurant to see if the port is open//sbin/iptables-l-n l-n.