在OpenLDAP中更改专有名称格式

Ind*_*dio 3 ldap alfresco distinguishedname

我有以下问题:我已安装和OpenLDAP服务器,其中在人员/用户树中,可分辨名称具有以下格式:

Distinguished Name: cn=Luigi Rossi,ou=people,dc=prisma,dc=local
Run Code Online (Sandbox Code Playgroud)

问题是我希望使用uid(也就是帐户用户名)而不是CN来替换它,以便有这样的东西

Distinguished Name: uid=lrossi,ou=people,dc=prisma,dc=local
Run Code Online (Sandbox Code Playgroud)

我需要这个,因为我正在为Alfresco Community 4.0.d配置ldap身份验证,它需要用户名

ldap.authentication.userNameFormat=uid=%s,ou=people,dc=prisma,dc=local
Run Code Online (Sandbox Code Playgroud)

有帮助吗?

小智 6

这是一个老帖子,但我自己遇到了这个问题.答案其实非常简单.如果您使用phpldapadmin创建帐户,则需要编辑posixAccount模板.寻找<rdn></rdn>标签.用uid替换cn并保存.您的帐户现在将使用"uid =%s,dc = example,dc = com"形式的DN创建,而不是"cn =%s,dc = example,dc = com"

http://phpldapadmin.sourceforge.net/wiki/index.php/Templates#Template_Header_Configuration


Ter*_*ner 5

使用modify DNLDAP 请求(在本例中使用旧版 OpenLDAPldapmodify工具):

uid可能需要添加该属性:

ldapmodify -h host -p port -D bind-dn -w password <<!
dn: cn=Luigi Rossi,ou=people,dc=prisma,dc=local
changetype: modify
add: uid
uid: lrossi
!

ldapmodify -h host -p port -D bind-dn -w password <<!
dn: cn=Luigi Rossi,ou=people,dc=prisma,dc=local
changetype: moddn
newrdn: uid=lrossi,ou=people,dc=prisma,dc=local
deleteoldrdn: 1
!
Run Code Online (Sandbox Code Playgroud)

也可以看看