AS4 U4裝vsftp+pam-mysql終於成功
經過翻閱論壇上的帖子以及數次的失敗,終於成功了,現總結一下,如有問題請指出
系統環境:redhat as 4 u4
Vsftp系統自帶
Mysql系統自帶
pam_mysql-0.7RC1.tar.gz
1、 安裝好系統自帶的vsftp和mysql,設置mysql的root密碼為
mysqladmin -u root password 新密碼
2、 創建mysql資料庫
create database ftpd;
use ftpd;
create table user(name char(20) binary,passwd char(20) binary);
insert into user (name,passwd) values ('test1','12345');
insert into user (name,passwd) values ('test2','54321');
grant select on ftpd.user to ftpd@localhost identified by '123456';
flush privileges;
quit
3、 安裝pam_mysql
tar xzvf pam_mysql-0.7RC1.tar.gz
cd pam_mysql-0.7RC1
./configure --with-openssl
make
make install
(之後檢查一下pam.mysql.so是否在/lib/security/下,如果不是可以從/usr/local/lib考過來)
4、 修改/etc/pam.d/vsftpd
vi /etc/pam.d/vsftpd
auth required /lib/security/pam_mysql.so user=ftpd passwd=123456 host=localhost db=ftpd table=user usercolumn=name passwdcolumn=passwd crypt=0
account required /lib/security/pam_mysql.so user=ftpd passwd=123456 host=localhost db=ftpd table=user usercolumn=name passwdcolumn=passwd crypt=0
5、 修改/etc/vsftpd/vsftpd.conf
pam_service_name=vsftpd
tcp_wrappers=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
chroot_local_user=YES
guest_enable=YES
guest_username=ftp
listen=YES
listen_port=21
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30999
anon_world_readable_only=NO
virtual_use_local_privs=YES
測試---登錄test1密碼12345成功
另外有個問題想問一下,我想實現每個FTP用戶都有並且鎖定在自己的文件夾,怎麼實現?
[ 本帖最後由 zyhui 於 2007-8-3 14:40 編輯 ]
《解決方案》
你好,我在centos 4中安裝
pam_mysql-0.7RC1]# ./configure --with-openssl
checking pam_appl.h usability... no
checking pam_appl.h presence... yes
configure: WARNING: pam_appl.h: present but cannot be compiled
configure: WARNING: pam_appl.h: check for missing prerequisite headers?
configure: WARNING: pam_appl.h: see the Autoconf documentation
configure: WARNING: pam_appl.h: section "Present But Cannot Be Compiled"
configure: WARNING: pam_appl.h: proceeding with the preprocessor's result
configure: WARNING: pam_appl.h: in the future, the compiler will take precedence
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to the pam_mysql lists. ##
configure: WARNING: ## ------------------------------------ ##
checking for pam_appl.h... yes
checking pam_modules.h usability... no
configure: error: Cannot find pam headers. Please check if your system is ready for pam module development.
出錯了,這是怎麼回事?
能幫我解決嗎?
謝謝!
《解決方案》
configure: error: Cannot find pam headers. Please check if your system is ready for pam module development.
《解決方案》
回復 #2 wyckwemail 的帖子
安裝配套的開發工具包,3樓正解.
configure: error: Cannot find pam headers. Please check if your system is ready for pam module development.
《解決方案》
不錯~
《解決方案》
了解下。
《解決方案》
應該是可以鎖定的,就是不能切換目錄。