-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add LDAP and update TOC #59
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
...l-CN/3.build-develop-and-administration/4.account-management-statements/LDAP.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# 集成 LDAP | ||
|
||
本文档介绍如何将 **Nebula Graph** 连接到 LDAP 服务器以进行身份验证(仅企业版可用)。 | ||
|
||
## LDAP 介绍 | ||
|
||
集成 LDAP 后, **Nebula Graph** 即可共享在 LDAP 中定义的用户身份信息和密码。 | ||
|
||
## 安装 LDAP 插件 | ||
|
||
1. 构建 LDAP 服务器并插入相应的记录。 | ||
|
||
例如,插入用户名 `test2`,密码 `passwdtest2`。然后使用以下命令查看用户: | ||
|
||
```bash | ||
ldapsearch -x -b 'uid=test2,ou=it,dc=sys,dc=com' | ||
``` | ||
|
||
2. 将 `auth_ldap.so` 文件放在安装路径的共享目录中。 | ||
3. 创建影子账户安装 `auth_ldap` 插件。 | ||
|
||
以 root 身份登录 **Nebula Graph**, 密码为 `nebula`,身份验证 `auth_type` 类型为 `password`: | ||
|
||
```bash | ||
./bin/nebula -u root -p nebula --port 3699 --addr="127.0.0.1" | ||
``` | ||
|
||
创建影子账户: | ||
|
||
```ngql | ||
# 此处需要为影子账户 test2 赋权 | ||
nebula> CREATE USER test2 WITH PASSWORD ""; | ||
Amber1990Zhang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
安装 `auth_ldap` 插件: | ||
|
||
```ngql | ||
nebula> INSTALL PLUGIN auth_ldap SONMAE "auth_ldap.so"; | ||
``` | ||
|
||
查看插件是否成功安装: | ||
|
||
```ngql | ||
nebula> SHOW PLUGINS; | ||
``` | ||
|
||
## 卸载 LDAP 插件 | ||
|
||
1. 以 root 身份登录 **Nebula Graph**, 密码为 `nebula`,身份验证 `auth_type` 类型为 `password`: | ||
|
||
```bash | ||
./bin/nebula -u root -p nebula --port 3699 --addr="127.0.0.1" | ||
``` | ||
|
||
2. 执行以下命令卸载 `auth_ldap` 插件: | ||
|
||
```ngql | ||
nebula> UNINSTALL PLUGIN auth_ldap; | ||
``` | ||
|
||
## 启用 LDAP 身份验证 | ||
|
||
**Nebula Graph** 默认禁用 LDAP 身份验证。执行以下操作启用 LDAP 身份验证: | ||
|
||
### 开启身份验证开关 | ||
|
||
首先,开启身份验证开关。打开 `nebula-graphd.conf` 文件(默认目录为 `/usr/local/nebula/etc/`),然后找到 `--enable_authorize`,将其更改为 `true`: | ||
|
||
```conf | ||
########## Authorization ########## | ||
# Enable authorization | ||
--enable_authorize=true | ||
``` | ||
|
||
### 配置 Nebula Graph | ||
|
||
然后配置 **Nebula Graph** 以使用 LDAP。您可以使用两种 LDAP 方法来为 **Nebula Graph** 开启身份验证。 | ||
|
||
- **简单绑定**。打开 `nebula-graphd.conf` 文件(默认目录为 `/usr/local/nebula/etc/`),找到 `Authentication` 部分,将 `auth_type` 更改为 `ldap` 并添加以下属性: | ||
|
||
```conf | ||
########## Authentication ########## | ||
# User login authentication type, password for nebula authentication, ldap for ldap authentication, cloud for cloud authentication | ||
--auth_type=ldap | ||
--ldap_server=127.0.0.1 | ||
--ldap_port=389 | ||
--ldap_scheme=ldap | ||
--ldap_prefix=uid= | ||
--ldap_suffix=,ou=it,dc=sys,dc=com | ||
``` | ||
|
||
- **搜索和绑定**. 打开 `nebula-graphd.conf` 文件(默认目录为 `/usr/local/nebula/etc/`),找到 `Authentication` 部分,将 `auth_type` 更改为 `ldap` 并添加以下属性: | ||
|
||
```conf | ||
########## Authentication ########## | ||
# User login authentication type, password for nebula authentication, ldap for ldap authentication, cloud for cloud authentication | ||
--auth_type=ldap | ||
--ldap_server=127.0.0.1 | ||
--ldap_port=389 | ||
--ldap_scheme=ldap | ||
--ldap_prefix=uid= | ||
--ldap_suffix=,ou=it,dc=sys,dc=com | ||
``` | ||
|
||
### 重启服务 | ||
|
||
保存并关闭配置文件,然后重启服务: | ||
|
||
```bash | ||
/usr/local/nebula/scripts/nebula.service restart all | ||
``` | ||
|
||
## 禁用 LDAP | ||
|
||
将 `nebula-graphd.conf` 中的 `--enable_authorize` 参数设置为 `false` 然后重启服务即可在 **Nebula Graph** 中禁用 LDAP 身份验证。 | ||
|
||
## 使用 LDAP 连接 Nebula Graph | ||
|
||
配置完成后,您可以使用 LDAP 身份验证连接到 **Nebula Graph**,运行以下命令: | ||
|
||
```bash | ||
./bin/nebula -u test2 -p passwdtest2 --port 3699 --addr="127.0.0.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个和上边写的重复了,留一处就好,建议留这里 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't' think so |
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
连接的时候不需要auth_type吧,这个是graphd的配置文件,需要在graphd启动前配置好
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是需要的