Skip to content

Commit

Permalink
update alter user (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-lzy authored Oct 11, 2023
1 parent 78599a9 commit e5f6393
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs-2.0/7.data-security/1.authentication/2.management-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,33 @@ The `root` user with the **GOD** role can run `ALTER USER` to set a new password
- Syntax with enterprise edition

```ngql
ALTER USER <user_name> WITH PASSWORD '<password>' [WITH IP WHITELIST <ip_list>];
ALTER USER <user_name> [WITH PASSWORD '<password>'] [WITH IP WHITELIST <ip_list>];
```

- Example with enterprise edition

!!! enterpriseonly

When `WITH IP WHITELIST` is not used, the IP address whitelist is removed and the user can connect to the NebulaGraph by any IP address.
Using `WITH IP WHITELIST` without any IP after it means whitelisting is canceled and users can connect to NebulaGraph using any IP.

```ngql
nebula> ALTER USER user2 WITH PASSWORD 'change_password';
nebula> ALTER USER user2 WITH PASSWORD 'nebula' WITH IP WHITELIST 192.168.10.10;
nebula> SHOW USERS;
+---------+-----------------+
| Account | IP Whitelist |
+---------+-----------------+
| "root" | "" |
| "user2" | "192.168.10.10" |
+---------+-----------------+
nebula> ALTER USER user2 WITH IP WHITELIST;
nebula> SHOW USERS;
+---------+--------------+
| Account | IP Whitelist |
+---------+--------------+
| "root" | "" |
| "user2" | "" |
+---------+--------------+
```

{{ ent.ent_end }}
Expand Down

0 comments on commit e5f6393

Please sign in to comment.