当前位置:网站首页>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
边栏推荐
- VIM, another program may be editing the same file If this is the solution of the case
- 敏捷开发/敏捷测试感受
- Understand bloomfilter in one article
- C language: the sorting problem of circle number reporting
- Communication tutorial | overview of the first, second and third generation can bus
- 求解:在oracle中如何用一条语句用delete删除两个表中jack的信息
- CTF竞赛题解之stm32逆向入门
- 面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
- runc hang 导致 Kubernetes 节点 NotReady
- 使用 NSProxy 实现消息转发
猜你喜欢
一文掌握数仓中auto analyze的使用
16. Memory usage and segmentation
Transformer principle and code elaboration (pytorch)
Leetcode day 17
Golang sets the small details of goproxy proxy proxy, which is applicable to go module download timeout and Alibaba cloud image go module download timeout
Detailed explanation of mt4api documentary and foreign exchange API documentary interfaces
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Concepts and theories related to distributed transactions
Jetson TX2配置Tensorflow、Pytorch等常用库
Play Sanzi chess easily
随机推荐
Article download address
Rsyslog配置及使用教程
二分查找的简单理解
mysql三级分销代理关系存储
从0到1建设智能灰度数据体系:以vivo游戏中心为例
游戏启动后提示安装HMS Core,点击取消,未再次提示安装HMS Core(初始化失败返回907135003)
使用 NSProxy 实现消息转发
干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
AI painting minimalist tutorial
请问大佬们有遇到这个情况吗,cdc 1.4 连接MySQL 5.7 无法使用 timestamp
C language array
16.内存使用与分段
C语言:求100-999是7的倍数的回文数
Why can the implementation class of abstractdispatcherservletinitializer be called when initializing the web container
爬虫练习题(一)
Two dimensional code coding theory
C语言数组
6 分钟看完 BGP 协议。
认知的定义
CANN算子:利用迭代器高效实现Tensor数据切割分块处理