mysql -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 创建远程连接账户
mysql -e "create user vsftpd@'192.168.31.%' identified by 'pana#123';"
mysql -e "grant all on vsftpd.* to vsftpd@'192.168.31.%';"
2. 安装ftp服务器
2.1 安装vsftpd
yum install -y vsftpd
2.2 安装pam_mysql
yum -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