Friday, December 16, 2011

[L] 在Fedora 15下开FTP (vsftpd)

网上有很多如何开FTP的教程,主要都是vsftpd.
但是,作为有着SELINUX的bug级fedora 15, 还需要我这样的小菜做更多努力才行,下面总结几点:

1.  vsftpd.conf
anonymous_enable=YES/NO
local_enable=YES/NO
不要傻傻地去注释

2. chroot_list
在vsftpd.conf里,如果chroot_local_user=YES,那么chroot_list里面有就是给整个目录,否则给chroot。比如我是ftptm, 那么我写进了chroot_list之后,用我的名字连上去就是"/home/ftptm", else it's just "/", like anonymous.

3. iptables
记得在iptables里面开20,21端口啊亲。还有iptables-config里面
iptables_modules="ip_conntrack_ftp"

4. selinux
如果你以为这样就结束了,你就上当了-- 你会发现用users连接的时候出现 "cannot change directory"这样的error.
getsebool -a | grep ftp
setsebool -P ftp_home_dir on
getsebool -a | grep ftp

就是让ftp_home_dir --> on就解决了。

*************************
结束,顺带一句,vsftpd is short for "very secure ftp daemon". Again, "very" secure. But I don't use it(ftps) though I study it...

No comments:

Post a Comment