32.10. 特殊文件.notar

无论您是否允许对目录进行即时 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   (1)
      [root@deep ] /# touch /home/ftp/lib/.notar   (2)
      [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 (3)
      [root@deep ] /# chmod 0 /home/ftp/lib/.notar (4)
      
(1)
仅当您未使用--enable-ls选项时才需要。
(2)
仅当您未使用--enable-ls选项时才需要。
(3)
仅当您未使用--enable-ls选项时才需要。
(4)
仅当您未使用--enable-ls选项时才需要。

零长度.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  (1)
        noretrieve /home/ftp/lib  (2)
      

(1)
仅当您未使用--enable-ls选项时才需要。
(2)
仅当您未使用--enable-ls选项时才需要。