当前位置:网站首页>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語言函數
- Transformer principle and code elaboration (tensorflow)
- Dry goods sorting! How about the development trend of ERP in the manufacturing industry? It's enough to read this article
- DC-5 target
- 诸神黄昏时代的对比学习
- Etcd 存储,Watch 以及过期机制
- C language: the sorting problem of circle number reporting
- 面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
- Transformer principle and code elaboration (pytorch)
- C language function
猜你喜欢
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Flet教程之 按钮控件 ElevatedButton入门(教程含源码)
When synchronized encounters this thing, there is a big hole, pay attention!
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
Transformer principle and code elaboration (pytorch)
轻松玩转三子棋
Master the use of auto analyze in data warehouse
Etcd storage, watch and expiration mechanism
C language array
How to realize the function of Sub Ledger of applet?
随机推荐
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Definition of cognition
BackgroundWorker用法示例
阿里云有奖体验:用PolarDB-X搭建一个高可用系统
jsonp
C語言:求100-999是7的倍數的回文數
使用 NSProxy 实现消息转发
6 分钟看完 BGP 协议。
mm_ Cognition of struct structure
WPF double slider control and forced capture of mouse event focus
ArcGis利用栅格处理工具进行影像裁剪
读《认知觉醒》
诸神黄昏时代的对比学习
Vit (vision transformer) principle and code elaboration
认知的定义
面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Detailed explanation of mt4api documentary and foreign exchange API documentary interfaces
CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合
敏捷开发/敏捷测试感受