About Port shutdown-Linux

Source: Internet
Author: User

From: http://blog.csdn.net/svitter

Cited by: http://bbs.chinaunix.net/thread-775649-1-1.html

1. Disable service stop

Netstat-ntlp

Kill-9 PID

2. Use two methods

1. ps aux | grep Port

Kill-9 PID

2. iptables-I INPUT-p tcp -- dport port number-j DROP

3. View services

Grep 8080/etc/services

Original Post published by wangyl1977
Grep 8080/etc/services

Webcache 8080/tcp # WWW caching service
Webcache 8080/udp # WWW caching service

[Quote] the original post was published by wumu888 at,-6-18.
Annotation in the services file


[/Quote]
This is just a reference table for "service_name/protocol & port ".
If you change the listen port of apache to 12345, then netstat-lp will see that port 12345 is listening
If you add port 12345 in/etc/services, the preceding comment is "platinum", then netstat-lp will become the platinum service.
If iptables is used for port DROP, iptables-vL will also see the same effect.
This is defined in/etc/nsswitch. conf. files is used for service parsing.
This function is affiliated with/lib/libnss_files.so.1 and/lib/libnss_files.so.2.

Many people have misunderstandings about/etc/services. They think that if a row of data is deleted/added, they can turn off/enable a service. This is an incorrect concept. Let me talk about it here.

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.