当前位置:网站首页>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
边栏推荐
- C語言函數
- 用fail2ban阻止密码尝试攻
- Play Sanzi chess easily
- C fonctions linguistiques
- Fastlane one click package / release app - usage record and stepping on pit
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- Netgear switch basic configuration command set
- Paper notes ACL 2020 improving event detection via open domain trigger knowledge
- Understand bloomfilter in one article
- 2022, 6G is heating up
猜你喜欢

诸神黄昏时代的对比学习

CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合

C fonctions linguistiques

Leetcode day 17

eclipse链接数据库中测试SQL语句删除出现SQL语句语法错误

n++也不靠谱

Master the use of auto analyze in data warehouse

DC-5靶机

ISO 27001 Information Security Management System Certification

When synchronized encounters this thing, there is a big hole, pay attention!
随机推荐
七、软件包管理
Runc hang causes the kubernetes node notready
再说rsync+inotify实现数据的实时备份
Wechat video Number launches "creator traffic package"
PostgreSQL 9.1 飞升之路
Introduction to the button control elevatedbutton of the fleet tutorial (the tutorial includes the source code)
Backgroundworker usage example
Two dimensional code coding theory
Netgear switch basic configuration command set
Valentine's Day confession code
7、 Software package management
使用 NSProxy 实现消息转发
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
C语言:求字符串的长度
Vit (vision transformer) principle and code elaboration
Reinforcement learning - learning notes 1 | basic concepts
I want to talk about yesterday
Article download address
Argminer: a pytorch package for processing, enhancing, training, and reasoning argument mining datasets
After installing vscode, the program runs (an include error is detected, please update the includepath, which has been solved for this translation unit (waveform curve is disabled) and (the source fil