如何Pureftpd和OpenLDAP

65次阅读
没有评论

共计 1560 个字符,预计需要花费 4 分钟才能阅读完成。

丸趣 TV 小编给大家分享一下如何 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”有了一定的了解,如果想了解更多相关知识,欢迎关注丸趣 TV 行业资讯频道,感谢各位的阅读!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-25发表,共计1560字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)