共計 1560 個字符,預(yù)計需要花費 4 分鐘才能閱讀完成。
丸趣 TV 小編給大家分享一下如何 Pureftpd 和 OpenLDAP,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
集成所需要的版本 如題:
PureFTPd 1.0.21
OpenLDAP 2.3.20
先說一下這種集成的需求根據(jù),我在公司里部署了 LDAP 服務(wù)器,作為公司各個應(yīng)用的認(rèn)證服務(wù)器,以實現(xiàn)單點登錄。FTP 服務(wù)器的用戶和認(rèn)證也需要與 LDAP 服務(wù)器集成。
OpenLDAP 的安裝網(wǎng)上已經(jīng)有很多例子和文檔了,這里就不多說了。重點需要注意的是 PureFTPd 的編譯安裝,PureFTPd 的安裝網(wǎng)上和該軟件包里的 README 文檔也說得很仔細(xì)了,但與 OpenLDAP2.3.10 集成有問題。
主要有 2 個問題,都與 FTPState 有關(guān):
(1)pureftp.schema 里的 Issue,F(xiàn)TPState 的屬性改為了 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 就可以了。
相關(guān)文件如下:
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
可以配置為關(guān)閉匿名訪問。
啟動 PureFTPd
# pure-config.pl pure-ftpd.conf
登錄即可
看完了這篇文章,相信你對“如何 Pureftpd 和 OpenLDAP”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道,感謝各位的閱讀!