Current location - Quotes Website - Collection of slogans - port mapping
port mapping
Linux check port command?

Commands for viewing ports on linux:

The first kind:

Lsof-i: port number

The second type:

Netstat-nltp|grep port number

-a: Displays all connection ports and listening ports of this machine.

-n: The form of network IP address, which shows the currently established valid connections and ports.

-r: display routing table information

-s: Display statistics by protocol.

-v: Displays the currently valid connections.

-t: display all TCP protocol connections.

-u: Show all UDP protocol connections.

-i: Displays the status of the auto-configuration port.

-l: Only the service network status with the connection status of monitoring is displayed.

-p: display pid/programname.

How to configure ssh client and how to connect to Linux server through ssh?

Open the remote control and port on the Linuxe server. Intranets can be directly connected with addresses and ports. External network needs to do port mapping.

1. Start the ssh(secureshell) service (mine is linuxubuntu 10. 10). Of course, before starting the ssh service, you need to download the relevant software. Use the following command: sudoapt-getinstallssh, then enter /etc/init.d, and enter the command: sudoservicesshstart to open the ssh service. Use netstat-tln to check whether the ssh service is turned on (ssh service uses 22 ports by default). To turn off the ssh service, use: sudoservicesshstop to turn off the ssh service.

2. Download the ssh client putty in the client (widnows host), fill in the linux server ip, sessionname, save it, open it, enter the user name and password, and log in successfully.

How does linux log into the background and the port number and protocol used?

Open cmd

1.netstat

View all ports used by this machine.

(1).Proto indicates that there are two protocols: tcp and udp.

②.LocalAddress indicates the IP of this machine, followed by the port number we use.

③.③。 The ForeignAddress connects to the IP address and server port of the external server.

④.State: indicates some specific states, such as LAST_ACK waiting for the used package to die.

2. Confirm the port number to query.

Command netstat-aon|findstr 1044 (specified port number)

The last digit of the query result is the pid of the current program or service.

3. Enter the command: tasklist|findstr26 12 (enter the pid queried above).

So you can see the programs running on this port.

Then query from the task manager, you can see this program.

4. If we use the specified port number in two schemes.

(1). End the running program of this port in the task manager, and then you can use this port number.

② Enter the command: taskkill/f/pid26 12 (enter the pid of the query) in the cmd interface, or you can kill this program.

Linux operating system

Netstat-tln# looks for all occupied ports.

Netstat-tln|grep80# Find the specified occupied port.

Install lsof

yuminstalllsof

Lsof can tell us which program the port belongs to.

Lsof-I: port of 80 # query

Kill-9# Kill process id Multiple process ids are separated by spaces.

What is the function of linux2 1 port?

Linux2 1 port is mainly used for FTP(FileTransferProtocol) service, which is mainly used for uploading and downloading files between two computers. One computer serves as an FTP client and the other computer serves as an FTP server. You can log in to the FTP server by using anonymous login and authorized user name password login.

At present, FTP service is the main way to upload and download files on the Internet. In addition, there is a 20 port, which is the default port number for FTP data transmission.