本文我給大家介紹兩款軟體的安裝過程:Pureftpd 和 OpenLDAP
整合所需要的版本 如題:
PureFTPd 1.0.21
OpenLDAP 2.3.20
先說一下這種整合的需求根據,我在公司裡部署了LDAP伺服器,作為公司各個應用的證明伺服器,以實現單點登入。FTP伺服器的使用者和認證也需要與LDAP伺服器整合。
OpenLDAP的安裝網上已經有很多例子和文檔了,這裡就不多說了。重點需要注意的是 PureFTPd的編譯安裝,PureFTPd的安裝網上和該軟體包裡的README文檔也說得很仔細了,但與OpenLDAP2.3.10整合有問題。
主要有2個問題,都與FTPState有關:
(1)pureftp.schema裡的Issue,FTPState 的屬性改為了boolean型,schema的文法有個錯誤。
(2)log_ldap.c裡沒有按schema的boolean型比較,而且用"enabled" 和 "disabled" 來作為FTPState的值來比較。
修正這兩個問題,整合就沒問題了。
編譯PureFTPd 如下:
- # ./configure --with-ldap=/usr/local/openldap --with-quotas --with-throttling --with-ratios
-
- # make; make check; make install;
然後沒配置好 pureftpd-ldap.conf 啟動PureFtpd就可以了。
相關檔案如下:
- pureftpd.schema
-
-
- attributetype ( 1.3.6.1.4.1.6981.11.3.7 NAME 'FTPStatus
-
-
- DESC 'Account status: enabled or disabled'
-
-
- EQUALITY booleanMatch
-
-
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
-
- pure-ftpd.conf
-
-
- # LDAP configuration file (see README.LDAP)
-
-
- LDAPConfigFile /usr/local/etc/pureftpd-ldap.conf
-
- pureftpd-ldap.conf
-
-
- # Optional : name of the LDAP server. Default : localhos
-
-
- LDAPServer your_ldap_hostname
-
-
- # Optional : server port. Default : 389
-
-
- LDAPPort 389
-
-
- # Mandatory : the base DN to search accounts from. No default.
-
-
- LDAPBaseDN ou=ftp,dc=your_company
-
-
- # Optional : who we should bind the server as.
-
-
- # Default : binds anonymously
-
-
- LDAPBindDN cn=admin,dc=your_company
-
-
- # Password if we don't bind anonymously
-
-
- # This configuration file should be only readable by root
-
-
- LDAPBindPW password
可以配置為關閉匿名訪問。
啟動PureFTPd
- # pure-config.pl pure-ftpd.conf
登入即可
通過文章的描述,相信大家都對Pureftpd 和 OpenLDAP 的安裝過程有了自己的心得,希望本文對大家有用。