2016-12-18 55 views
1

我正在寻找一种方式来更新由该用户的条目DN更新用户的DN:使用CN使用UID

dn: cn=Super,ou=Prod,ou=clients,dc=test,dc=com 

要这样:

dn: uid=SuperUID,ou=Prod,ou=clients,dc=test,dc=com 

鉴于我的目录下有多个ou,还有一些已经在他们的DN中使用了UID属性,所以我只需要更新这个ou。 另外,我的ldap服务器正在运行openDJ。

我一直在寻找这里和其他地方,但我找不到任何工作的答案。

我不断收到此错误:

Result Code: 65 (Object Class Violation) 
Additional Information: The modify DN operation for entry [...] cannot be performed because the change would have violated the server schema: Entry [...] violates the Directory Server schema configuration because it is missing attribute cn which is required by objectclass person 

我的理解(当然,那种)这是什么错误是告诉我,但我无法找到我的身边这种方式来解决我的问题......

谢谢

回答

2

您必须使用ModDN重命名条目。但为了使条目符合模式(当您更改命名属性时),您必须保留以前的值。 下面的变化将工作:

ldapmodify -D cn=directory\ manager -w password -h localhost -p 1389 

dn: cn=Super,ou=Prod,ou=clients,dc=test,dc=com 
changetype: moddn 
newrdn: uid=SuperUID 
deleteoldrdn: false 

你可以修改cn属性来改变它的值,使用修改操作。

+0

感谢Ludovic,我应该试图将deleteoldrdn设置为0 .... – Pier

相关问题