Assume that there are a bunch of machines in which the IP address of the server to be accessed is 192.168.1.1 and the IP address to be accessed is 192.168.1.2. you don't need to write the rest, and you don't need it anyway. In linux, the SSH connection is basically used. the file control method can be used to implement the connection through hosts. allow and hosts under the/etc directory.
Assume that there are a bunch of machines in which the IP address of the server to be accessed is 192.168.1.1 and the IP address to be accessed is 192.168.1.2. you don't need to write the rest, and you don't need it anyway.
In fact, the linux system is basically connected by using SSH, which can be implemented through file control.
In fact, it is done through the hosts. allow and hosts. deny files under the/etc directory.
The hosts. allow file is used to add IP addresses allowed for access:
# Perform the following steps on the 192.168.1.1 server
# Vi/etc/hosts. allow
Add this file
Sshd: 192.168.1.2
Save and exit;
# Vi/etc/hosts. deny
Add this file
Sshd: all
Save and exit.
In this way, only 192.168.1.2 can access the machine 192.168.1.1 through SSH. other servers can be pinged but cannot log on.