openldap监控

https://github.com/shanghai-edu/ldap-test-tool/releases/

配置文件
默认配置文件为目录下的 cfg.json,也可以使用 -c 或 --config 来加载自定义的配置文件。

openldap 配置示例

{
“ldap”: {
“addr”: “ldap.example.org:389”,
“baseDn”: “dc=example,dc=org”,
“bindDn”: “cn=manager,dc=example,dc=org”,
“bindPass”: “password”,
“authFilter”: “(&(uid=%s))”,
“attributes”: [“uid”, “cn”, “mail”],
“tls”: false,
“startTLS”: false
},
“http”: {
“listen”: “0.0.0.0:8888”
}
}
AD 配置示例

{
“ldap”: {
“addr”: “ad.example.org:389”,
“baseDn”: “dc=example,dc=org”,
“bindDn”: “manager@example.org”,
“bindPass”: “password”,
“authFilter”: “(&(sAMAccountName=%s))”,
“attributes”: [“sAMAccountName”, “displayName”, “mail”],
“tls”: false,
“startTLS”: false
},
“http”: {
“listen”: “0.0.0.0:8888”
}
}
命令体系
命令行部分使用 cobra 框架,可以使用 help 命令查看命令的使用方式

./ldap-test-tool help

ldap-test-tool is a simple tool for ldap test
build by shanghai-edu.
Complete documentation is available at github.com/shanghai-edu/ldap-test-tool

Usage:
ldap-test-tool [flags]
ldap-test-tool [command]

Available Commands:
auth Auth Test
help Help about any command
http Enable a http server for ldap-test-tool
search Search Test
version Print the version number of ldap-test-tool

Flags:
-c, --config string load config file. default cfg.json (default “cfg.json”)
-h, --help help for ldap-test-tool

Use “ldap-test-tool [command] --help” for more information about a command.
认证
./ldap-test-tool auth -h
Auth Test

Usage:
ldap-test-tool auth [flags]
ldap-test-tool auth [command]

Available Commands:
multi Multi Auth Test
single Single Auth Test

Flags:
-h, --help help for auth

Global Flags:
-c, --config string load config file. default cfg.json (default “cfg.json”)

Use “ldap-test-tool auth [command] --help” for more information about a command.
单用户测试

命令行说明

Single Auth Test

Usage:
ldap-test-tool auth single [username] [password] [flags]

Flags:
-h, --help help for single

Global Flags:
-c, --config string load config file. default cfg.json (default “cfg.json”)
示例

./ldap-test-tool auth single qfeng 123456
LDAP Auth Start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值