无论您是否允许对目录进行即时 tar 压缩,您都应确保在所有不允许上传参数的区域中,都无法使用 tar 命令绕过限制。为此,请创建特殊文件.notar在每个目录和FTP目录中。
[root@deep ] /# touch /home/ftp/.notar [root@deep ] /# touch /home/ftp/etc/.notar [root@deep ] /# touch /home/ftp/dev/.notar [root@deep ] /# touch /home/ftp/bin/.notar [root@deep ] /# touch /home/ftp/lib/.notar [root@deep ] /# chmod 0 /home/ftp/.notar [root@deep ] /# chmod 0 /home/ftp/etc/.notar [root@deep ] /# chmod 0 /home/ftp/dev/.notar [root@deep ] /# chmod 0 /home/ftp/bin/.notar [root@deep ] /# chmod 0 /home/ftp/lib/.notar
零长度.notar文件可能会使某些 Web 客户端和FTP代理感到困惑,因此让我们将其标记为不可检索以解决此问题。将以下行添加到您的/etc/ftpaccess文件中。
noretrieve .notar
noretrieve 命令。 Wu-ftpd 服务器的 noretrieve 参数允许您拒绝传输选定的目录或文件。防止下载以下子目录也是一个好主意bin, etc, dev,和lib在/home/ftp目录中使用 noretrieve 命令在您的/etc/ftpaccess文件中。
# We'll prevent downloads with noretrieve. noretrieve /home/ftp/etc noretrieve /home/ftp/dev noretrieve /home/ftp/bin noretrieve /home/ftp/lib