通过MySQL实现虚拟用户访问vsftpd服务器
时间:2021-07-01 10:21:17
帮助过:3人阅读
yum -y install vsftpd mysql-server mysql-devel pam-devel gcc-c++ make wget
service mysqld start
mysqladmin -uroot password redhat
mysql -uroot -predhat
create database vftpuser;
use vftpuser;
create table users(name char(
41),
pwd char(
41));
insert into users(name,
pwd) values(
‘test‘,password(
‘test‘));
grant select on vftpuser.users to vsqluser@localhost identified by
‘redhat‘;
flush privileges;
quit;
wget http://ncu.dl.sourceforge.net/project/pam-mysql/pam-mysql/
0.7RC1/pam_mysql-
0.7RC1.tar.gz
tar xzf pam_mysql-
0.7RC1.tar.gz
cd pam_mysql-
0.7RC1
./configure
make && make install
auth required /lib/security/pam_mysql.so user=vsqluser passwd=redhat host=localhost db=vftpuser table=users usercolumn=name passwdcolumn=
pwd crypt=
2
account required /lib/security/pam_mysql.so user=vsqluser passwd=redhat host=localhost db=vftpuser table=users usercolumn=name passwdcolumn=
pwd crypt=
2
useradd
-d /var/ftp/vuserdir
-s /sbin/nologin vuser
listen=YES
pam_service_name=vsftpd
guest_enable=YES
guest_username=vuser
anonymous_enable=NO
anon_world_readable_only=NO
local_enable=YES
service vsftpd start
通过MySQL实现虚拟用户访问vsftpd服务器
标签: