Linux View port number commands

Source: Internet
Author: User
Tags domain name server file transfer protocol

Under Linux, if we need to know the port number No. 2809, we can do this, like the following command:

$netstat-pan|grep 24800

TCP 0 0 0.0.0.0:24800 0.0.0.0:* LISTEN 4496/synergys
TCP 0 0 192.168.1.104:24800 192.168.1.106:49479 established 4496/synergys

The following are explanations of common parameters:

NETSTAT [-A] [-b] [-e] [-n] [-O] [-P proto] [-r] [-S] [-v] [interval]

-a displays all connections and listening ports.

-B Displays the executable components that are included in creating each connection or listening port. In some cases, the executable component is known

has multiple independent components, and in these cases

A sequence of components that are included in creating a connection or listening port is displayed. In this case, the name of the executable component

At the bottom of [], the top is the component it calls, and so on, until the TCP/IP section. Note this option

It may take a long time to fail if insufficient permissions are available.

  

-e Displays Ethernet statistics. This option can be used in combination with the-s option.

  

-N Displays the address and port number in digital form.

-O Displays the owning process ID associated with each connection.

-p proto shows the connection proto the specified protocol; proto can be

One of the following protocols: TCP, UDP, TCPv6, or UDPV6.

If used with the-s option to display per-protocol statistics, Proto can be one of the following protocols:

IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPV6.

-r Displays the routing table.

-S displays statistical information by protocol. By default, the display IP,

IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPV6 statistics;

The-p option specifies a subset of the default conditions.

  

-V is used with the-B option to display the containing

Creates a component that connects or listens on ports for all executable components.

  

Interval Displays the selected statistics, between each display

Pause interval (in seconds). Press CTRL + C to stop re-

Displays statistics. If omitted, Netstat displays the current

Configuration information (show only once)

NETSTAT-NL | grep 110

You can use it if you see the result (the port number is turned on)

First, you can look at the/etc/services file, change the file definition of all the services in Linux and the ports used

Small knowledge:

For example, to turn off port 25 of the SMTP service in Windows 2000/XP: First open Control Panel, double-click Administrative Tools, and then double-click Services. Next, locate and double-click the "Simple Mail Transfer Protocol (SMTP)" Service in the Open Services window, stop the service by clicking the Stop button, then select "Disabled" in startup type, and then click the OK button. In this way, shutting down the SMTP service is equivalent to shutting down the corresponding port.

Open port

If you want to turn on the port, simply select Automatic in Startup type, click the OK button, then open the service, click the Start button in service status to enable the port, and finally click the OK button.

21 Ports: 21 ports are primarily used for FTP (file Transfer Protocol, document Transfer Protocol) services.

23 Port: 23 port is primarily used for Telnet (remote login) services and is a common logon and emulator on the Internet. 25 Ports: 25 ports are open for SMTP (Simple Mail Transfer Protocol, Easy message Transfer Protocol) servers, primarily for sending mail, and today most mail servers use the protocol.

53 Port: Port 53 is open for DNS (domain name server, nameserver) server, mainly used for domain name resolution, and DNS service is the most widely used in NT system.

67, 68 ports: 67, 68 ports are ports that are open for bootstrap Protocol Server (Bootstrapper Protocol Service side) and bootstrap Protocol client (Bootstrapper protocol clients) for BOOTP services respectively.

69 Port: TFTP is a simple File Transfer protocol developed by Cisco Corporation, similar to FTP.

79 Port: 79 port is open for the finger service, mainly used to query the remote host online users, operating system type and whether buffer overflow and other user details.

80 Ports: 80 ports are open for HTTP (Hypertext Transport Protocol, Hypertext Transfer Protocol), which is the most used protocol for surfing the Internet, primarily for protocols that transmit information on the WWW (World Wide Web) service.

99 Port: 99 port is used for a service called "Metagram Relay" (sub-countermeasure delay), the service is relatively rare, generally not used.

109, 110 Port: 109 port is open for POP2 (post Office Protocol Version 2, Post Offices Protocol 2) service, 110 port is open for POP3 (Mail Protocol 3) service, POP2, POP3 are mainly used to receive mail.

Port 111: Port 111 is a port that is open by the Sun's RPC (remote Procedure Call) service, primarily for internal process communication of different computers in a distributed system, and RPC is an important component in a variety of network services.

113 Ports: 113 ports are primarily used for Windows "Authentication Service" (authentication services).

119 Ports: 119 ports are open for "Network news Transfer Protocol" (Web newsgroup Transfer Protocol, or NNTP).

135 Ports: 135 ports are primarily used by RPC (remote Procedure call, Remoting) protocol and provide DCOM (distributed Component Object Model) services.

137 Ports: 137 ports are primarily used for the NetBIOS name Service (NetBIOS naming services).

139 Ports: 139 ports are provided for "NetBIOS Session service" and are primarily used to provide Windows file and printer sharing and Samba services in UNIX.

143 Port: 143 port is primarily used for "Internet Message Access Protocol" V2 (Internet Messaging Protocol, abbreviated as IMAP).

161 Ports: 161 ports are used for "Simple Network Management Protocol" (Simplified Web Management Protocol, referred to as SNMP).

443 Port: Port 43 is a web browsing port, primarily for HTTPS services, and is another HTTP that provides encryption and transmission over a secure port.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.