当前位置:网站首页>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
边栏推荐
- 老掉牙的 synchronized 锁优化,一次给你讲清楚!
- C语言:围圈报号排序问题
- 数据库锁表?别慌,本文教你如何解决
- CANN算子:利用迭代器高效实现Tensor数据切割分块处理
- PostgreSQL 9.1 飞升之路
- jsonp
- Flet教程之 按钮控件 ElevatedButton入门(教程含源码)
- Is there an elegant way to remove nulls while transforming a Collection using Guava?
- 阿里云有奖体验:用PolarDB-X搭建一个高可用系统
- Cadence physical library lef file syntax learning [continuous update]
猜你喜欢

A treasure open source software, cross platform terminal artifact tabby

n++也不靠谱
![Cadence physical library lef file syntax learning [continuous update]](/img/d5/0671935b074e538a2147dbe51a5a70.jpg)
Cadence physical library lef file syntax learning [continuous update]

面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读

众昂矿业:为保障萤石足量供应,开源节流势在必行

昨天的事情想说一下

ArgMiner:一个用于对论点挖掘数据集进行处理、增强、训练和推理的 PyTorch 的包

C#/VB.NET 给PDF文档添加文本/图像水印

Runc hang causes the kubernetes node notready

Full arrangement (medium difficulty)
随机推荐
Langue C: trouver le nombre de palindromes dont 100 - 999 est un multiple de 7
asp. Core is compatible with both JWT authentication and cookies authentication
[leetcode] 96 and 95 (how to calculate all legal BST)
WPF双滑块控件以及强制捕获鼠标事件焦点
游戏启动后提示安装HMS Core,点击取消,未再次提示安装HMS Core(初始化失败返回907135003)
[Android kotlin] lambda return statement and anonymous function
CTF竞赛题解之stm32逆向入门
AbstractDispatcherServletInitializer 的实现类为什么可以在初始化Web容器的时候被调用
《天天数学》连载57:二月二十六日
Valentine's Day confession code
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
C语言:求100-999是7的倍数的回文数
Runc hang causes the kubernetes node notready
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
比量子化学方法快六个数量级,一种基于绝热状态的绝热人工神经网络方法,可加速对偶氮苯衍生物及此类分子的模拟
mysql三级分销代理关系存储
R language -- readr package reads and writes data
DC-5靶机
Two dimensional code coding theory
6 分钟看完 BGP 协议。