Current location - Quotes Website - Collection of slogans - Linux port viewing process Linux port viewing process
Linux port viewing process Linux port viewing process
Linux checks which network card is bound to the port?

Generally speaking, ports are not bound to network cards. Once the port is opened, which network card can be connected to another port, but the program can bind the IP address. Once the IP address is bound, it depends on which port is set to change the IP.

Netstat-ano|grepnn//nn represents the port. You can see if there is such information as ip:nn in the result, and then check which port this ip is set in ifconfig, and you can almost determine it. If the result is 0.0.0.0:nn, the IP address is not bound, and the network card is not bound.

How to check which program of linux occupies the port?

Check the port usage and use the netstat command.

View the connected service port (ESTABLISHEDnetstat-a) View all service ports (LISTEN, ESTABLISHED)netstat-ap View port 8080, and then you can combine the grep command: netstat-ap|grep8080 If you view port 8888, enter: lsof-i:8888linux login background mode and port number and protocol used by the terminal?

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 other viewing ports does linux have besides telnet?

Netstat-an looks at the network port lsof-i:port. Through lsof-i:port, you can see the programs running at the specified port and the current connection.

Nmap port scanning

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.