如何向apacheDS添加新的user

1.Right-click on the [color=red]ou=users[/color] node and select [b]New Entry[/b]. The [b]New Entry[/b] wizard appears.

2.In the [b]Entry Creation Method[/b] pane, you do not need to change any settings. Click [b]Next[/b].

3.In the Object Classes pane, select [color=red]inetOrgPerson [/color]from the list of [b]Available object classes[/b] on the left and then click [b]Add [/b]to populate the list of [b]Selected object classes[/b]. Click [b]Next[/b].

[img]http://dl.iteye.com/upload/picture/pic/123715/50726bc0-b6d5-349c-a3af-dbda4c939186.gif[/img]

4.In the [b]Distinguished Name[/b] pane, complete the [b]RDN [/b]field, putting [color=red]uid [/color]in front and [color=red]jdoe [/color]after the equals sign. Click [b]Next[/b].

[img]http://dl.iteye.com/upload/picture/pic/123717/ac342828-27e0-3bf6-92f2-fe6139988ac0.gif[/img]

5.Now fill in the remaining mandatory attributes in the [b]Attributes [/b]pane. Set the [b]cn [/b](common name) attribute to [color=red]John Doe[/color] and the [b]sn [/b](surname) attribute to [color=red]Doe[/color]. Click [b]Finish[/b].

[img]http://dl.iteye.com/upload/picture/pic/123719/3c7dabe6-172a-38d0-9dc7-ee7ef90a17f7.gif[/img]

6.Add a [color=red]userPassword [/color]attribute to the user entry. In the [b]LDAP Browser[/b] view, you should now be able to see a new node, [color=red]uid=jdoe[/color]. Select the [color=red]uid=jdoe[/color] node. Now, right-click in the [b]Entry Editor[/b] view and select New Attribute. The [b]New Attribute[/b] wizard appears.

7.From the [b]Attribute type[/b] drop-down list, select [color=red]userPassword[/color]. Click Finish.

8.The [b]Password Editor[/b] dialog appears. In the [b]Enter New Password[/b] field, enter the password, [color=red]123456[/color]. Click [b]Ok[/b].

9.To add more users, repeat steps 7 to 14.

10.To verify new created user and password, right-click the connection name, select [b]Properties[/b], click on [b]Authentication[/b], enter the username you just created and the password.

or you can test connection with apacheDS API, sample:

LdapConnection connection = new LdapNetworkConnection("192.168.71.82", 10389);
BindRequest bindRequest = new BindRequestImpl();
Dn dn = new Dn("uid=mike,ou=users,ou=system");
bindRequest.setDn(dn);
bindRequest.setCredentials("123456");
BindResponse bindResponse = connection.bind(bindRequest);
System.out.println(bindResponse.getLdapResult());
connection.unBind();
connection.close();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值