In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Install vsftpd, here yum installation or source code installation;
2. Install mysql, skip it, you can view the previous document;
3. Install pam-mysql, dependent on pam-devel package;
[root@WebA-136 ~]#tar xf pam_mysql-0.7RC1.tar.gz
[root@WebA-136 ~]#yum install pam-devel
[root@WebA-136 ~]#./ configure --with-mysql=/usr/local/mysql --with-openssl
[root@WebA-136 ~]#make && make install
[root@WebA-136 ~]#less README
[root@WebA-136 ~]#vim /etc/pam.d/vsftpd.mysql
[root@WebA-136 ~]#cat /etc/pam.d/vsftpd.mysql
[root@WebA-136 ~]#auth required /lib/security/pam_mysql.so user=vsftpd passwd=123456 host=192.168.146.136 db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=3 md5=yes
[root@WebA-136 ~]#account required /lib/security/pam_mysql.so user=vsftpd passwd=123456 host=192.168.146.136 db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=3 md5=yes
reconfigure database
create database vsftp;
grant selcet on vsftp.* to vsftpd@192.168.146.136 identified by '123456';
create tables
create table users(
id smallint auto_increment not null,
name char(20) binary not null,
password char(48) binary not null,
primary key(id))
;
View table structure
desc users;
You also need to insert virtual users here
INSERT INTO users(name,password)VALUES('tom',md5(123456)),('jack',md5(123456));
4. Modify the vsftpd.conf configuration file for mysql authentication
First create user
useradd -s /sbin/nologin -d /var/ftp-test vsftp
chmod go+rx /var/ftp-test
Make sure the following options are turned on in vsftpd.conf
[root@WebA-136 ~]#vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=NO
anon_mkdir_write_enable=NO
chroot_local_user=YES
Add the following options
guest_enable=YES
guest_username=vsftpd#####All virtual users must map to a specified user.
listen=YES
pam_service_name=vsftpd.mysql
Note: Different access permission settings can be implemented according to different virtual users.
Added in vsftpd.conf
user_config_dir=/etc/vsftpd/test
Add a file with the same name as the virtual user to/etc/vsftpd/test directory
cd /etc/vsftpd/test
vim tom
anon_upload_enable=YES
anon_mkdir_write_enable=YES
vim jack
anon_upload_enable=NO
anon_mkdir_write_enable=NO
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.