当前位置:网站首页>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
边栏推荐
- Etcd 存储,Watch 以及过期机制
- C#/VB. Net to add text / image watermarks to PDF documents
- Wechat video Number launches "creator traffic package"
- Netgear switch basic configuration command set
- Is there an elegant way to remove nulls while transforming a Collection using Guava?
- C語言函數
- 爬虫练习题(一)
- 2022, 6G is heating up
- Alibaba cloud award winning experience: build a highly available system with polardb-x
- 【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源
猜你喜欢
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
Fundamentals of container technology
CTF竞赛题解之stm32逆向入门
Full arrangement (medium difficulty)
DVWA range exercise 4
ArcGIS uses grid processing tools for image clipping
Meituan Ali's Application Practice on multimodal recall
Transformer principle and code elaboration (tensorflow)
[leetcode] 96 and 95 (how to calculate all legal BST)
Fly tutorial 02 advanced functions of elevatedbutton (tutorial includes source code) (tutorial includes source code)
随机推荐
golang 设置goproxy代理的小细节,适用于go module下载超时,阿里云镜像go module下载超时
Etcd storage, watch and expiration mechanism
Read the BGP agreement in 6 minutes.
Agile development / agile testing experience
阿里云有奖体验:用PolarDB-X搭建一个高可用系统
【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源
Transformer principle and code elaboration (pytorch)
Flet教程之 按钮控件 ElevatedButton入门(教程含源码)
[leetcode] 96 and 95 (how to calculate all legal BST)
从0到1建设智能灰度数据体系:以vivo游戏中心为例
C语言:求字符串的长度
读《认知觉醒》
When synchronized encounters this thing, there is a big hole, pay attention!
iptables基础及Samba配置举例
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
mysql三级分销代理关系存储
使用Scrcpy投屏
C#/VB. Net to add text / image watermarks to PDF documents
Using nsproxy to forward messages
2022年中国移动阅读市场年度综合分析