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.
This article aims to use the clearest structure t...
React originated as an internal project at Facebo...
One trick for dealing with this type of error is t...
Apache Tomcat is an open source software that imp...
1. Install Docker on the server yum install docke...
The concept of lock ①. Lock, in real life, is a t...
Overview There are many form requirements in the ...
Unicode Signature BOM - What is the BOM? BOM is th...
Table of contents introduction Install Homebrew I...
This article example shares the specific code of ...
Table of contents 1. Introduction to Nginx 1. Wha...
<br />I just saw the newly revamped ChinaUI....
When I used g++ to compile the cpp file for the f...
Recently, when I was using the Linux operating sy...
The MySQL built-in date function TIMESTAMPDIFF ca...