In Linux, seal the IP address and service-Linux Enterprise Application-Linux server application information. The following is a detailed description. Author: netbull
Hosts. allow and hosts. deny.
Check hosts. deny first, then check hosts. allow,
The latter can be set beyond the former limit,
For example:
1. restrict all telnet requests,
Unless it is from 202.115.64.0 -- 127.
Hosts. deny:
In. telnetd: ALL
Hosts. allow:
In. telnetd: 202.115.64.0/255.255.255.255.128
2. Disable telnet for 202.115.64.0 -- 127.
Hosts. deny
In. telnetd: 202.115.64.0/255.255.255.255.128
3. restrict all TCP connections, unless accessed from 202.115.64.0 -- 127
Hosts. deny
ALL: ALL
Hosts. allow
ALL: 202.115.64.0/255.255.255.255.128
4. Restrict 202.115.64.0 -- 127 access to all services
Hosts. deny
ALL: 202.115.64.0/255.255.255.255.128
The front of the colon is the name of the TCP daemon service process.
The process is specified in/etc/inetd. conf, such as in. ftpd AND in. telnetd.
The IP address range is written in the following three ways:
1. network address-subnet mask mode:
202.112.1.0/255.255.255.0
2. network address method (I call it myself, haha)
202.112. (IP addresses starting with 202.112)
3. scale down the subnet mask. The number of "1" in front of the two-digit subnet mask is as follows:
202.112.1.0/255.255.255.0 ===202.112.1.0/24
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