如果SELinux拒绝vsftpd上传文件到用户主目录怎么办


用惯了vsftpd,觉得vsftpd非常实用而且安全,但是那些初学者经常会遇到一些问题如下:

系统是CentOS 5.1,创建用户后,不能登陆FTP,在/var/log/messages文件记录以下信息:

Mar 31 13:46:15 localhost kernel: audit(1206942375.697:5719): avc: denied { append } for pid=32111 comm="vsftpd" name="test" dev=sda3 ino=19400200 scontext=root:system_r:ftpd_t:s0 tcontext=root:object_r:root_t:s0 tclass=file

SELinux ftp daemon policy is customizable based on least access required. So by default SElinux does not allow users to login and read their home directories.

If you are setting up this machine as a ftpd server and wish to allow users to access their home directorories, you need to set the ftp_home_dir boolean.

执行命令:

setsebool -P ftp_home_dir 1

上传文件成功。

通过阅读上面文章,你是否也遇到过这样类似的问题,那就请留言给我,我帮你们解答!

  • vsftpd 傻瓜版安装全流程
  • vsftpd 傻瓜版配置全流程
  • vsFTPd常用小功能二条
  • vsFTPd常用功能之限速和限制链接点
  • vsFTPd常用功能之修改默认目录
  • vsFTPd常用功能之设置虚拟路径和查看日志信息
  • vsftpd入门——安装、配置、案例与常见问题
  • Debian上配置vsftpd常见问答集锦

相关内容