1. TCP Wrappers Overview TCP Wrappers "wraps" the TCP service program and listens to the port of the TCP service program on its behalf, adding a security detection process. External connection requests must first pass this layer of security detection and obtain permission before accessing the real service program. As shown in the figure below, TCP Wrappers can also record all attempts to access the protected service, providing administrators with rich security analysis information. 2. Access strategy of TCP Wrappers The TCP Wrappers mechanism protects various network service programs and performs access control on the client addresses that access the services. The two corresponding policy files are /etc/hosts.allow and /etc/hosts.deny, which are used to set the allow and deny policies respectively. 1. Policy configuration format The two policy files have opposite functions, but the format of the configuration records is the same, as follows: The service program lists and client address lists are separated by colons, and multiple items in each list are separated by commas. 1) Service program list
2) Client address list
2. Basic principles of access control Regarding the access policy of the TCP Wrappers mechanism, the following order and principles are followed when applying it: first check the /etc/hosts.allow file. If a matching policy is found, access is allowed. Otherwise, continue to check the /etc/hosts.deny file. If a matching policy is found, access is denied. If no matching policy is found in the above two files, access is allowed. 3. TCP Wrappers Configuration Example When the TCP Wrappers mechanism is actually used, a looser policy may be "allow all, deny some", and a stricter policy may be "allow some, deny all". The former only needs to add the corresponding deny policy in the hosts.deny file; the latter, in addition to adding the allow policy in host.allow, also needs to set the deny policy of "ALL:ALL" in the hosts.deny file. Here is an example: Now you only want to access the sshd service from the host with IP address 192.168.10.1 or the host in the 172.16.16 network segment. Other addresses are rejected. You can do the following: [root@centos01 ~]# vim /etc/hosts.allow sshd:192.168.10.1 172.16.16.* [root@centos01 ~]# vim /etc/hosts.deny sshd:ALL The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Some notes on modifying the innodb_data_file_path parameter of MySQL
>>: Vue realizes web online chat function
I wonder if you have ever thought about this ques...
The default template method is similar to vue2, u...
Table of contents 1. DOM Diff 2. Add key attribut...
This article example shares the specific code for...
1. Common MySQL configuration All the following c...
Table of contents 1. Several syntaxes of Insert 1...
When any project develops to a certain complexity...
Table of contents 1. View the tables in the curre...
When you first start learning Linux, you first ne...
Table of contents 1. Prototype 2. Prototype chain...
Table of contents 1. Demand 2. Solution 3. The fi...
Run and compile your programs more efficiently wi...
Use the following command to check whether MySQL ...
Table of contents environment: 1. Docker enables ...
Table of contents Overview Build Process Related ...