风信网(ithov.com)原创文章,今天测试Centos登陆vsftp创建文件553 Could not create file报错信息如下:
响应:&">nbsp;227 Entering Passive Mode (192,168,1,6,251,12).
命令: LIST
响应: 150 Here comes the directory listing.
响应: 226 Directory send OK.
状态: 列出目录成功
状态: 开始上传 C:\Users\Administrator\AppData\Local\Temp\fz3temp-1\empty_file_yq744zm
命令: PASV
响应: 227 Entering Passive Mode (192,168,1,6,120,119).
命令: STOR fdsaf
响应: 553 Could not create file.
错误: 严重文件传输错误
发现没有权限创建文件或是目录,查找原因,原来是selinux引起的登陆问题。
为避免每次开机都要作这个操作,可在setsebool命令后面加上-P选项,使改动永久有效。
[root@localhost webserver]# sestatus -b| grep ftp
allow_ftpd_anon_write off
allow_ftpd_full_access off
allow_ftpd_use_cifs off
allow_ftpd_use_nfs off
ftp_home_dir on
ftpd_connect_db off
ftpd_use_passive_mode off
httpd_enable_ftp_server off
tftp_anon_write off
如果你使用本地用户登陆vsftpd出现如下错误500 OOPS: cannot change directory:/home/ithov,请参阅这篇文章《vsftpd中FTP登陆500 OOPS: cannot change directory:/home/ithov错误解决方法》
需要设置allow_ftpd_full_access为on状态,
[root@localhost webserver]# setsebool allow_ftpd_full_access on
[root@localhost webserver]# sestatus -b| grep ftp
allow_ftpd_anon_write off
allow_ftpd_full_access on
allow_ftpd_use_cifs off
allow_ftpd_use_nfs off
ftp_home_dir on
ftpd_connect_db off
ftpd_use_passive_mode off
httpd_enable_ftp_server off
tftp_anon_write off
重新登陆ftp再来创建文件或目录,成功啦!