如果SELinux拒絕vsftpd上傳文件到用戶(hù)主目錄怎么辦
用慣了vsftpd,覺(jué)得vsftpd非常實(shí)用而且安全,但是那些初學(xué)者經(jīng)常會(huì)遇到一些問(wèn)題如下:
系統(tǒng)是CentOS 5.1,創(chuàng)建用戶(hù)后,不能登陸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.
執(zhí)行命令:
setsebool -P ftp_home_dir 1
上傳文件成功。
通過(guò)閱讀上面文章,你是否也遇到過(guò)這樣類(lèi)似的問(wèn)題,那就請(qǐng)留言給我,我?guī)湍銈兘獯穑?/P>
【編輯推薦】