WEB开发网
开发学院服务器FTP服务器 linux下ftp服务器架设 阅读

linux下ftp服务器架设

 2007-07-13 16:19:54 来源:WEB开发网   
核心提示:upload命令在默认情况下,WU-FTPD服务器给所有的guest用户上载的权限,linux下ftp服务器架设(5),当用户登录的时候,被改变根目录(chroot)到“/home/ftp”就不能访问这个目录之外的地方,在“/home/ftp”目录的每个子目录中都创建&l

upload命令

在默认情况下,WU-FTPD服务器给所有的guest用户上载的权限。当用户登录的时候,被改变根目录(chroot)到“/home/ftp”就不能访问这个目录之外的地方。但是“/home/ftp”目录中的一些地方还是需要保护,不能让用户随便访问。在我们配置的ftp服务器中为“/home/ftp”目录下的“bin”、“etc”、“dev”和“lib”目录。我们不允许用户上载文件到这些目录。所以我们要为这些目录设置访问权限,可以在“/etc/ftpaccess”文件中设置上载权限。在我们的例子中是这样设置的:

upload /home/ftp/* / no
upload /home/ftp/* /etc no
upload /home/ftp/* /dev no
upload /home/ftp/* /bin no (require only if you are not using the “--enable-ls” option)
upload /home/ftp/* /lib no (require only if you are not using the “--enable-ls” option)

noretrieve命令

最好禁止某些用户从“/home/ftp”目录下的某些子目录中下载文件,可以用“noretrieve”命令在“/etc/ftpaccess”文件中设置。

noretrieve /home/ftp/etc
noretrieve /home/ftp/dev
noretrieve /home/ftp/bin (require only if you are not using the “--enable-ls” option)
noretrieve /home/ftp/lib (require only if you are not using the “--enable-ls” option)

“.notar”文件
无论是否允许即时的目录打包(on-the-fly tar),都必须保证用户不能打包(tar)禁止上载的目录。在“/home/ftp”目录的每个子目录中都创建“.notar”文件。

[root@deep]# touch /home/ftp/.notar
[root@deep]# chmod 0 /home/ftp/.notar
[root@deep]# touch /home/ftp/etc/.notar
[root@deep]# chmod 0 /home/ftp/etc/.notar
[root@deep]# touch /home/ftp/dev/.notar
[root@deep]# chmod 0 /home/ftp/dev/.notar
[root@deep]# touch /home/ftp/bin/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# chmod 0 /home/ftp/bin/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# touch /home/ftp/lib/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# chmod 0 /home/ftp/lib/.notar (require only if you are not using the “--enable-ls” option)

这些长度为0的“.notar”文件会使一些浏览器和ftp代理(proxy)出现混乱,要解决这个问题必须把它们标识为禁止下载。在“/etc/ftpaccess”文件中加入这一行:

noretrieve .notar

安装到系统中的文件

> /etc/ftphosts
> /etc/ftpusers
> /etc/ftpaccess
> /etc/pam.d/ftp
> /etc/ftpconversions
> /etc/ftpgroups
> /etc/logrotate.d/ftpd
> /usr/bin/ftpcount
> /usr/bin/ftpwho
> /usr/man/man1/ftpcount.1
> /usr/man/man1/ftpwho.1
> /usr/man/man5/ftpaccess.5
> /usr/man/man5/ftphosts.5
> /usr/man/man5/ftpconversions.5
> /usr/man/man5/xferlog.5
> /usr/man/man8/ftpd.8
> /usr/man/man8/ftpshut.8
> /usr/man/man8/ftprestart.8
> /usr/sbin/in.ftpd
> /usr/sbin/ftpshut
> /usr/sbin/ckconfig
> /usr/sbin/ftprestart
> /usr/sbin/xferstats
> /usr/sbin/wu.ftpd
> /usr/sbin/in.wuftpd
> /var/log/xferlog

上一页  1 2 3 4 5 

Tags:linux ftp 服务器

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接