完美解决lftp遇到put: Access failed: 553 Could not create file.

 目录

一、问题

二、原因

三、解决方法


一、问题

put: Access failed: 553 Could not create file.

二、原因

(1)没有关闭SeLinux

(2)linux默认安装vsftp服务之后只允许匿名用户的访问和下载,不支持上传。

三、解决方法

方法一:

关闭SeLinux

setenforce 0

使用vim命令编写 /etc/sysconfig/selinux,修改为SELINUX=disabled 

vim /etc/sysconfig/selinux

完美解决lftp遇到put: Access failed: 553 Could not create file._第1张图片

试下能不能上传文件了,不成功使用方法二。

方法二:

修改文件vsftpd.conf

vi /etc/vsftpd/vsftpd.conf

进入后会发现很多注释(带#的),需要修改如下内容,但是很麻烦,建议直接全部删除,直接输入如下内容。

write_enable=YES
 
anon_umask=022
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
 
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
 
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

编辑完成后保存退出,重新启动vsftp服务。

systemctl restart vsftpd

如果都没有成功,使用下面方法。

getsebool -a | grep ftp

完美解决lftp遇到put: Access failed: 553 Could not create file._第2张图片

setsebool -P allow_ftpd_anon_write on  
setsebool -P allow_ftpd_full_access on 

好了,快去试下吧~

你可能感兴趣的:(#,问题解决,centos,服务器)