1. MySQL installationyum -y install mariadb-server systemctl enable --now mariadb.service 1.2 Create tables, databases, and usersmysql -e "CREATE DATABASE vsftpd;USE vsftpd; CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, name CHAR(50) BINARY NOT NULL, password CHAR(48) BINARY NOT NULL); INSERT INTO users(name,password) values('qiu',password('123456')); INSERT INTO users(name,password) values('zhang',password('654321'));" mysql -e "select * from vsftpd.users;" 1.3 Create a remote connection accountmysql -e "create user vsftpd@'192.168.31.%' identified by 'Pana#123';" mysql -e "grant all on vsftpd.* to vsftpd@'192.168.31.%';" 2. Install FTP server2.1 Install vsftpdyum install -y vsftpd 2.2 Install pam_mysqlyum -y install vsftpd gcc gcc-c++ make mariadb-devel pam-devel wget http://prdownloads.sourceforge.net/pam-mysql/pam_mysql-0.7RC1.tar.gz tar xf pam_mysql-0.7RC1.tar.gz cd pam_mysql-0.7RC1/ ./configure --with-pam-mods-dir=/lib64/security make install 2.2 Create the files required for PAM authenticationcat > /etc/pam.d/vsftpd.mysql<<EOF auth required pam_mysql.so user=vsftpd passwd=Pana#123 host=mysqlserver db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=2 account required pam_mysql.so user=vsftpd passwd=Pana#123 host=mysqlserver db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=2 EOF Note: The above refers to the README document 2.3 Create vsftpd usermkdir -pv /data/ftproot/upload useradd -d /data/ftproot -s /sbin/nologin -r vuser setfacl -mu:vuser:rwx /data/ftproot/upload 2.4 Modify the vsftpd configuration filemkdir /etc/vsftpd/conf.d/ sed -Eri "s#(pam_service_name=vsftpd)#\1.mysql#" /etc/vsftpd/vsftpd.conf echo "guest_enable=YES" >> /etc/vsftpd/vsftpd.conf echo "guest_username=vuser" >> /etc/vsftpd/vsftpd.conf 2.5 Restart vsftpd servicesystemctl enable --now vsftpd This is the end of this article about vsftpd virtual users based on MySql authentication. For more related MySql vsftpd virtual users content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: The effect of zooming in on a Taobao store is similar to the principle of using a slideshow.
In the world of web development, frameworks are ve...
Table of contents Preface 1. Check the file disk ...
Configure Git environment in Docker At work, I en...
Recorded the installation tutorial of mysql 5.7.1...
To understand load balancing, you must first unde...
Table of contents Preface 1. Install NJS module M...
The following attributes are not very compatible w...
Table of contents 1. Build Docker 2. Enter the co...
Table of contents What are spread and rest operat...
1. Download the MySQL installation package First ...
Background In Docker, four containers are created...
Recently, the company has put forward a requireme...
In the past few years of my career, I have writte...
This article example shares the specific code of ...
Table of contents Difference between MVC and MVVM...