匿名用户可以通过ftp服务上传,下载,删除文件同时上传目录文件的权限是722。

解答:
(1)关闭防火墙设置SELinux
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
(2)安装包
[root@localhost ~]# yum install vsftpd -y
启动服务:
[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# systemctl enable vsftpd
[root@localhost ~]# systemctl status vsftpd
在这里插入图片描述
(3)修改配置文件
匿名用户下载文件:
在这里插入图片描述
[root@localhost ftp]# touch file
在这里插入图片描述
直接将创建的下载桌面下载成功
匿名用户上传文件:
[root@localhost ftp]# vim /etc/vsftpd/vsftpd.conf
在这里插入图片描述
anon_upload_enable=YES(上传普通文件的权限)
anon_mkdir_write_enable=YES(上传目录文件的权限)
重启服务:
[root@localhost ftp]# systemctl restart vsftpd
匿名用户默认访问的服务器的目录是/var/ftp/,如果要实现匿名用户可以上传文件,要进行相关权限设置。
[root@localhost ftp]# chmod o+w /var/ftp/pub/
将桌面的文件上传:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
匿名用户删除文件设置上传文件的权限:
[root@localhost ftp]# vim /etc/vsftpd/vsftpd.conf
添加如下命令:
在这里插入图片描述
[root@localhost ftp]# systemctl restart vsftpd
[root@localhost ftp]# cd pub/
[root@localhost pub]# ll //查看上传文件权限
在这里插入图片描述
在这里插入图片描述
2、通过本地用户访问ftp服务器时,除了silver用户,其他所有用户都被限制在自己的家目录内。
解答:
(1)修改配置文件
在这里插入图片描述
(2)添加允许用户
在这里插入图片描述
[root@localhost pub]# vim /etc/vsftpd/chroot_list
[root@localhost pub]# cat /etc/vsftpd/chroot_list
silver
重启服务:
[root@localhost pub]# systemctl restart vsftpd
添加用户:
[root@localhost pub]# useradd xiaoming
[root@localhost pub]# useradd xiaohong
[root@localhost pub]# echo “red” | passwd --stdin xiaoming
Changing password for user xiaoming.
passwd: all authentication tokens updated successfully.
(3) 测试
在这里插入图片描述
在这里插入图片描述
其他用户被限制在自己的主目录内
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43928088/article/details/107307995