如何使用 ldapscripts 中的 ldapmodifyuser 更改值

如何使用 ldapscripts 中的 ldapmodifyuser 更改值

我找不到如何使用的示例ldap脚本命令ldapmodifyuser,我不太熟悉,无法ldapmodify弄清楚。

例如,我如何使用ldapmodifyuser来更改用户的givenName

这是我的尝试:

~$ sudo ldapmodifyuser 9928892
# About to modify the following entry :
dn: uid=9928892,ou=Users,dc=thisplace,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: 9928892
sn: FUJI
givenName: GABUTO
cn: GABUTO FUJISHITA
displayName: GABUTO FUJISHITA
uidNumber: 18055
gidNumber: 5000
gecos: GABUTO FUJISHITA
loginShell: /bin/bash
homeDirectory: /home/9928892
userPassword:: e2NyeXB0fS...
shadowLastChange: 17575

# Enter your modifications here, end with CTRL-D.
dn: uid=9928892,ou=Users,dc=thisplace,dc=com
givenName:GAKUTO      # Ctrl+D
Error modifying user entry uid=9928892,ou=Users,dc=thisplace,dc=com in LDAP

答案1

你没有指定

changetype: modify

replace: givenName

本来应该是:

sudo ldapmodifyuser 9928892
# About to modify the following entry :
dn: uid=9928892,ou=Users,dc=thisplace,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: 9928892
sn: FUJI
givenName: GABUTO
cn: GABUTO FUJISHITA
displayName: GABUTO FUJISHITA
uidNumber: 18055
gidNumber: 5000
gecos: GABUTO FUJISHITA
loginShell: /bin/bash
homeDirectory: /home/9928892
userPassword:: e2NyeXB0fS...
shadowLastChange: 17575

# Enter your modifications here, end with CTRL-D.
dn: uid=9928892,ou=Users,dc=thisplace,dc=com
changetype: modify
replace: givenName
givenName:GAKUTO      # Ctrl+D

相关内容