关于在linux下搭建VSFTP下匿名不能上传的问题:
 
在/etc/vsftpd/vsftpd.conf(vsftpd的核心配置文件)中
 配置如下:
 anonymous_enable=YES(允许匿名访问)
 anon_upload_enable=YES (允许匿名上传)
 anon_mkdir_write_enable=YES(允许匿名创建文件)#如果不需要可为NO或者注释掉,保存退出。
 在终端里输入如下:
 [root@localhost ~]# ll -d /var/ftp
 drwxr-xr-x 3 root root 4096 03-22 14:09 /var/ftp
 [root@localhost ~]# mkdir /var/ftp/student(student是自己新建的文件夹,在var/ftp里默认有个pub文件夹)
 [root@localhost ~]# ll -d /var/ftp/student/
 drwxr-xr-x 2 root root 4096 03-22 15:10 /var/ftp/student/
 [root@localhost ~]# chown ftp /var/ftp/student/
 [root@localhost ~]# ll -d /var/ftp/student/
 drwxr-xr-x 2 ftp root 4096 03-22 15:10/var/ftp/student/
 [root@localhost ~]# getsebool -a | grep ftp
 allow_ftpd_anon_write --> off
 allow_ftpd_full_access --> off
 allow_ftpd_use_cifs --> off
 allow_ftpd_use_nfs --> off
 allow_tftp_anon_write --> off
 ftp_home_dir --> off
 ftpd_disable_trans --> on
 ftpd_is_daemon --> on
 httpd_enable_ftp_server --> off
 tftpd_disable_trans --> off
 [root@localhost ~]# setsebool -P allow_ftpd_anon_write
 Usage:  setsebool [ -P ] boolean value | bool1=val1 bool2=val2...
 [root@localhost ~]# setsebool -P allow_ftpd_anon_write on
 [root@localhost ~]# getsebool -a | grep ftp
 allow_ftpd_anon_write --> on
 allow_ftpd_full_access --> off
 allow_ftpd_use_cifs --> off
 allow_ftpd_use_nfs --> off
 allow_tftp_anon_write --> off
 ftp_home_dir --> off
 ftpd_disable_trans --> on
 ftpd_is_daemon --> on
 httpd_enable_ftp_server --> off
 tftpd_disable_trans --> off
 [root@localhost ~]# ls -Zd /var/ftp/student
 drwxr-xr-x  ftp root rootbject_r:public_content_t   /var/ftp/student
 [root@localhost ~]# chcon -t public_content_rw_t /var/ftp/student
 [root@localhost ~]# ls -Zd /var/ftp/student/
 drwxr-xr-x  ftp root rootbject_r:public_content_rw_t /var/ftp/student/
 在此重启电脑,在终端运行一下:
 [root@localhost ~]# chkconfig --list |grep vsftpd
 vsftpd          0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭
 [root@localhost ~]# chkconfig --level 3 vsftpd on
 [root@localhost ~]# chkconfig --list |grep vsftpd
 vsftpd          0:关闭  1:关闭  2:关闭  3:启用  4:关闭  5:关闭  6:关闭
 [root@localhost ~]# service vsftpd start
 为 vsftpd 启动 vsftpd:                                    [确定]