当前位置:网站首页>高效!用虚拟用户搭建FTP工作环境
高效!用虚拟用户搭建FTP工作环境
2022-07-04 12:36:00 【51CTO】

此前,使用vsftp工具来搭建ftp时,我们使用的用户为Linux的系统用户,而当我们的人员过多时,且都需要用各自的账户登录,那么管理起来将会非常地不方便。使用虚拟用户的方式能很好的解决这个问题,不占用系统用户!
1.配置基础环境
关闭seliux
2.安装vsftp
这里需要安装两个模块,分别为vsftpd和db4-utils。
3.修改配置
养成好习惯,修改配置前备份一下配置,以防止后续修改后无法启动时作为参考依据。
修改配置如下:
vim vsftpd.conf
listen=YES
anonymous_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
chroot_local_user=YES
allow_writeable_chroot=YES
guest_enable=yes
guest_username=vsftpd
user_config_dir=/etc/vsftpd/vsftpd_user_conf
pam_service_name=vsftpd
local_enable=YES
pasv_enable=YES
# 被动模式,占用5090-6000端口
#listen_port=52221
pasv_min_port=5090
pasv_max_port=6000
#pasv_address=49.235.71.50
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
4.创建虚拟用户账户文件
在文件中填入用户名和密码,其中单行是用户名,双行是密码,比如我设置了两个用户user1和user2,他们两个的密码都是123456:
5.根据虚拟用户账户文件生成虚拟用户配置文件 vsftpd_login.db
6.配置虚拟用户登录认证,注释掉全部内容,新增下面的两行,最终效果如下:
vim /etc/pam.d/vsftpd
#%PAM-1.0
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
#session optional pam_keyinit.so force revoke
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
#auth required pam_shells.so
#auth include password-auth
#account include password-auth
#session required pam_loginuid.so
#session include password-auth
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
7.限制虚拟用户切换主目录
8.创建配置文件目录
10.创建vsftpd用户(与vsftpd.conf 文件中的:guest_username=vsftpd 一致)
10.按用户名为每个用户写配置内容
仅下载权限
上传、下载权限,不能删除、不能重命名
全部权限:可上传、下载、删除和改名
11、重启vsftpd服务
12.允许vsftp防火墙通过
边栏推荐
- CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合
- Peak detection of measured signal
- Understand bloomfilter in one article
- C语言:围圈报号排序问题
- 0x15 string
- Runc hang causes the kubernetes node notready
- 从0到1建设智能灰度数据体系:以vivo游戏中心为例
- C language: find the palindrome number whose 100-999 is a multiple of 7
- 使用 NSProxy 实现消息转发
- Transformer principle and code elaboration (pytorch)
猜你喜欢

Introduction to the button control elevatedbutton of the fleet tutorial (the tutorial includes the source code)
![[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods](/img/e6/2b46d72049ea50f89d0234eab88439.png)
[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods

golang 设置goproxy代理的小细节,适用于go module下载超时,阿里云镜像go module下载超时

实时云交互如何助力教育行业发展

面试官:Redis 过期删除策略和内存淘汰策略有什么区别?

16. Memory usage and segmentation

ArgMiner:一个用于对论点挖掘数据集进行处理、增强、训练和推理的 PyTorch 的包

CA:用于移动端的高效坐标注意力机制 | CVPR 2021

8个扩展子包!RecBole推出2.0!

Leetcode day 17
随机推荐
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
从0到1建设智能灰度数据体系:以vivo游戏中心为例
[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods
Global and Chinese market for naval vessel maintenance 2022-2028: Research Report on technology, participants, trends, market size and share
mysql三级分销代理关系存储
Etcd 存储,Watch 以及过期机制
Master the use of auto analyze in data warehouse
C fonctions linguistiques
go-zero微服务实战系列(九、极致优化秒杀性能)
6 分钟看完 BGP 协议。
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
C language: the sorting problem of circle number reporting
Runc hang causes the kubernetes node notready
2022, 6G is heating up
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
runc hang 导致 Kubernetes 节点 NotReady
Netgear switch basic configuration command set
CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合
面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读