centos7最小版安装vsftpd,另一台客户机无法上传文件,报put: Access failed: 553 Could not create file

配置文件如下:
1 # Example config file /etc/vsftpd/vsftpd.conf
2 #
3 # The default compiled in settings are fairly paranoid. This sample file
4 # loosens things up a bit, to make the ftp daemon more usable.
5 # Please see vsftpd.conf.5 for all compiled in defaults.
6 #
7 # READ THIS: This example file is NOT an exhaustive list of vsftpd options.
8 # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
9 # capabilities.
10 #
11 # Allow anonymous FTP? (Beware - allowed by default if you comment this out).
12 anonymous_enable=YES
13 #
14 # Uncomment this to allow local users to log in.
15 # When SELinux is enforcing check for SE bool ftp_home_dir
16 local_enable=YES
17 #
18 #Uncomment this to enable any form of FTP write command.
19 write_enable=YES
20 #
21 # Default umask for local users is 077. You may wish to change this to 022,
22 # if your users expect that (022 is used by most other ftpd's)
23 local_umask=022
24 #
25 # Uncomment this to allow the anonymous FTP user to upload files. This only
26 # has an effect if the above global write enable is activated. Also, you will
27 # obviously need to create a directory writable by the FTP user.
28 # When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
29 anon_upload_enable=YES
30 #
31 # Uncomment this if you want the anonymous FTP user to be able to create
32 # new directories.
[root@lx ftp]# ll
总用量 0
drwxr-xr-x. 2 ftp ftp 40 12月 29 17:10 pub
-rw-r--r--. 1 root root 0 12月 29 16:02 test.txt
权限也给了ftp,但是还是无法上传

首先,你如果允许匿名用户访问,需要配置如下配置:
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES

img


允许匿名用户上传文件并可以创建目录

img


允许匿名用户上传文件并可以创建目录


之后改变权限
# chown -R ftp.ftp /var/ftp/pub/            #修改FTP共享目录属主、属组为ftp用户。
如果进行测试,结果:可以新建文件夹,但是不能重命名,不能删除!
 
# vim vsftpd.conf        #编辑FTP配置文件,修改以下内容。
anon_other_write_enable=YES          #默认没有,需要手动添加下这行。
 
重启FTP服务,使配置文件生效:
# systemctl restart vsftpd

可以删除文件夹了,这个参数对匿名用户来说权限太大,不安全,掂量使用这个参数
注意,默认匿名用户家目录的权限是755,这个权限是不能改变的。切记!

看到题主点赞解决,如有帮助,望采纳支持~~谢谢