要限制FTPServer(FTP服务器)的访问IP,您需要根据所使用的FTP服务器软件进行操作。以下是针对一些常见FTP服务器软件的方法:
FileZilla Server(Windows):
vsftpd(Linux):
/etc/vsftpd/vsftpd.conf。使用文本编辑器打开,如:sudo nano /etc/vsftpd/vsftpd.conf。tcp_wrappers=YES
/etc/hosts.deny文件,添加以下行以拒绝所有IP地址访问FTP服务器:vsftpd: ALL
/etc/hosts.allow文件,添加允许访问FTP服务器的IP地址,如下所示:vsftpd: 192.168.1.1
vsftpd: 192.168.1.2-192.168.1.10
sudo systemctl restart vsftpd。Pure-FTPd(Linux):
/etc/pure-ftpd/pure-ftpd.conf。使用文本编辑器打开,如:sudo nano /etc/pure-ftpd/pure-ftpd.conf。AllowUser *
DenyUser *
sudo touch /etc/pure-ftpd/auth/99AllowIPsudo nano /etc/pure-ftpd/auth/99AllowIP192.168.1.1
192.168.1.2-192.168.1.10
sudo systemctl restart pure-ftpd。请注意,这些示例仅适用于特定版本的FTP服务器软件。您可能需要根据您的操作系统和FTP服务器软件版本进行调整。在进行更改之前,请确保备份所有配置文件。