当前位置:网站首页>Efficient! Build FTP working environment with virtual users
Efficient! Build FTP working environment with virtual users
2022-07-04 12:56:00 【51CTO】

before , Use vsftp Tools to build ftp when , The users we use are Linux Of the system users , And when we have too many people , And they all need to log in with their own accounts , Then it will be very inconvenient to manage . Using virtual users can solve this problem well , Do not occupy system users !
1. Configure the base environment
close seliux
2. install vsftp
Here you need to install two modules , Respectively vsftpd and db4-utils.
3. Modify the configuration
Develop good habits , Back up the configuration before modifying it , To prevent it from starting after subsequent modification .
Modify the configuration as follows :
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
# Passive mode , Occupy 5090-6000 port
#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. Create a virtual user account file
Fill in the user name and password in the file , One line is the user name , Double line is password , For example, I set up two users user1 and user2, Their passwords are both 123456:
5. Generate virtual user profile according to virtual user account file vsftpd_login.db
6. Configure virtual user login authentication , Comment out everything , Add the following two lines , The end result is as follows :
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. Restrict virtual users from switching home directories
8. Create a directory of configuration files
10. establish vsftpd user ( And vsftpd.conf In the document :guest_username=vsftpd Agreement )
10. Write the configuration content for each user according to the user name
Download permission only
Upload 、 Download permissions , Can't delete 、 You can't rename
All permissions : Can upload 、 download 、 Delete and rename
11、 restart vsftpd service
12. allow vsftp The firewall goes through
边栏推荐
- Detailed explanation of mt4api documentary and foreign exchange API documentary interfaces
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- CANN算子:利用迭代器高效实现Tensor数据切割分块处理
- mysql三级分销代理关系存储
- Understand bloomfilter in one article
- Play Sanzi chess easily
- Talk about "in C language"
- 游戏启动后提示安装HMS Core,点击取消,未再次提示安装HMS Core(初始化失败返回907135003)
- PostgreSQL 9.1 飞升之路
- C语言函数
猜你喜欢

从0到1建设智能灰度数据体系:以vivo游戏中心为例

AI 绘画极简教程

求解:在oracle中如何用一条语句用delete删除两个表中jack的信息

Flet教程之 按钮控件 ElevatedButton入门(教程含源码)

Valentine's Day confession code

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

ISO 27001 Information Security Management System Certification

阿里云有奖体验:用PolarDB-X搭建一个高可用系统

Concepts and theories related to distributed transactions

Fly tutorial 02 advanced functions of elevatedbutton (tutorial includes source code) (tutorial includes source code)
随机推荐
Wechat video Number launches "creator traffic package"
16.内存使用与分段
使用 NSProxy 实现消息转发
Simple understanding of binary search
0x15 string
Fastlane one click package / release app - usage record and stepping on pit
洞见科技解决方案总监薛婧:联邦学习助力数据要素安全流通
爬虫练习题(一)
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
6 分钟看完 BGP 协议。
游戏启动后提示安装HMS Core,点击取消,未再次提示安装HMS Core(初始化失败返回907135003)
When synchronized encounters this thing, there is a big hole, pay attention!
【云原生 | Kubernetes篇】深入了解Ingress(十二)
敏捷开发/敏捷测试感受
AbstractDispatcherServletInitializer 的实现类为什么可以在初始化Web容器的时候被调用
【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源
Master the use of auto analyze in data warehouse
分布式事务相关概念与理论
Comprehensive evaluation of modular note taking software: craft, notation, flowus
强化学习-学习笔记1 | 基础概念