網站伺服器在某一次的更新後(應該是 SELinux policy 更動了),FTP 服務變得無法上傳,解決方法是執行以下指令:

setsebool -P allow_ftpd_full_access=1

但由於某帳號的家目錄是直接指向 /var/www/html 導致該指令出現以下錯誤訊息:

「 homedir /var/www/html or its parent directory conflicts with a defined context in /etc/selinux/targeted/contexts/files/file_contexts, /usr/sbin/genhomedircon will not create a new context. This usually indicates an incorrectly defined system account. If it is a system account please make sure its login shell is /sbin/nologin.」

最直接的解法是將 /etc/passwd 裡、該帳號的 shell 改成 /sbin/nologin,再執行剛才的指令即可。執行完畢後可以再將 shell 改回來。