vsftp 利用mysql 验证虚拟账户
时间:2021-07-01 10:21:17
帮助过:23人阅读
(1) yum install -y vsftpd(2)编辑vsftpd.conf内容如下listen=YESconnect_from_port_20=YESpasv_enable=YEStcp_wrappers=YESlocal_enable=YESchroot_local_user=yesanonymous_enable=NOguest_enable=YESguest_username=vsftpdguestuser_config_dir=/etc/vsftpd/vsftpd_user_confpam_service_name=/etc/pam.d/vsftpddirmessage_enable=YESidle_session_timeout=600check_shell=NO(3)创建一个虚拟用户映射系统用户 useradd –s /sbin/nologin vsftpdguest2 安装 mysql具体步骤参考 http://www.lishiming.net/thread-7-1-2.html
3 安装 pam-mysqlwget http://cdnetworks-kr-1.dl.source ... mysql-0.7RC1.tar.gz
tar zxvf pam_mysql-0.7RC1.tar.gzcd pam_mysql-0.7RC1./configure --with-mysql=/usr/local/mysql --with-pam=/usr --with-pam-mods-dir=/usr/libmake && make install4 创建vsftp 库和相关的表并授权>create database vsftp;>use vsftp ;>create table users ( name char(16) binary ,passwd char(125) binary ) ;>insert into users (name,passwd) values (‘test001‘,password(‘123456‘));>insert into users (name,passwd) values (‘test002‘,password(‘234567‘));>grant select on vsftp.users to vsftpdguest@localhost identified by ‘vsftpdguest‘;5 创建虚拟账户的配置文件mkdir /etc/vsftpd/vsftpd_user_conf cd /etc/vsftpd/vsftpd_user_confvim test001内容如下local_root=/ftp/ write_enable=YESvirtual_use_local_privs=YESchmod_enable=YES6 编辑验证文件vim /etc/pam.d/vsftpd内容如下#%PAM-1.0auth required /usr/lib/pam_mysql.so user=vsftpdguest passwd=vsftpdguest host=localhost db=vsftp table=users usercolumn=name passwdcolumn=passwd crypt=2account required /usr/lib/pam_mysql.so user=vsftpdguest passwd=vsftpdguest host=localhost db=vsftp table=users usercolumn=name passwdcolumn=passwd crypt=2vsftp 利用mysql 验证虚拟账户
标签:具体步骤 mysql listen 用户