Installation Environment:
CentOS 6.6 x86_64
First, Introduction
The Vsftpd:very secure FTP daemon is a very secure FTP process and is the name of a server running on a GPL-released UNIX-like class operating system that can run on systems such as Linux, BSD, Solaris, HP-UX, and IRIX. VSFTPD supports a number of good features that are not supported by other traditional FTP servers.
Second, VSFTPD installation and configuration files
#yum-y Install vsftpd #安装
#rpm-QL vsftpd | Less #查看安装后文件
#cd/etc/vsftpd
#cp Vsftpd.conf{,.bak} #备份
User Authentication profile:/etc/pam.d/vsftpd
Service script:/ETC/RC.D/INIT.D/VSFTPD
Configuration file directory:/ETC/VSFTPD
Master configuration file: vsftpd.conf
Third, install MySQL and pam_mysql
1. Install the appropriate software
#yum-y install vsftpd mysql-server mysql-devel pam_mysql
2. Install MySQL
#mysql >create DATABASE vsftpd;>use vsftpd;>grant SELECT on vsftpd.* to [email protected] ' 172.16.%.% ' Indentified by ' Mageedu;>flush privileges#mysql-u vsftp-h 172.16.200.22 #远程连接测试 >create TABLE users (#创建表- ID INT UNSIGNED NOT NULL auto_increment PRIMARY KEY,-->name VARCHAR (a) binary NOT null,-->password CHAR ($) binary Not NULL): >desc Users;>insert into users (' Tom ', password (' mageedu ')), (' Jerry ', Password (' Name,password Mageedu.com ')); Create User >select * from users; #查看用户
3. Configure the Authentication file
#vim/etc/pam.d/vsftpd.mysqlauth required/lib64/security pam_mysql.so user=vsftp password=mageedu host=172.16.200.7 DB=VSFTPD table=users usercolumn=name passwdcolumn=password crypt=2 #认证用户及密码 account required/lib64/security Pam_mysql . So user=vsftp passwod=mageedu host=172.16.200.7 db=vsftpd table=users usercolumn=name passwdcolumn=password crypt=2 # Verify that the user is out of date
4. Configuration files
#useradd-S/sbin/nologin-d/var/ftproot vuser #chmod go+rx/var/ftproot #让其它用户读执行权 #vim/etc/vsftpd/vsftpd.conf #修改以下信 Interest Anonymous_enable=yes local_enable=yes write_enable=yes anon_upload_enable=no anon_mkdir_write_enable=no chroot_ Local_user=yes Virtual user option: Pam_service_name=vsftpd.mysql guest_enable=yes guest_username=vuser #service vsftpd Restart # Tail/var/log/messages
5. Configure virtual users to have different access rights
#vim vsftpd.conf user_config_dir=/etc/vsftpd/vusers_config #mkdir/etc/vsftpd/vusers_config #cd/etc/vsftpd/vusers_ Config #touch Tom #vim Tom Anon_upload_enable=yes anon_mkdir_enable=yes anon_other_write_enable=yes #cp Tom Jerry #vim Jer Ry Anon_upload_enable=no anon_mkdir_enable=no anon_other_write_enable=no #service vsftpd Restart
This article is from "snail" blog, please be sure to keep this source http://linuxkingdom.blog.51cto.com/6334977/1651553
VSFTPD based on MySQL file sharing