Manage users
Users can be created and managed using a set of Cypher administration commands executed against the system database.
When connected to the DBMS over bolt, administration commands are automatically routed to the system database.
User states
There are two types of user states in the system database:
ACTIVEstate-
(default for new users) Users can log into Neo4j and perform queries according to their privileges.
SUSPENDEDstate Enterprise Edition-
-
Native users who authenticate and authorize against the system graph cannot log into Neo4j. If suspended while using Neo4j, they lose all assigned roles with their privileges, including the
PUBLICrole, until reactivated. -
Users who authenticate and authorize against an external ID provider (e.g., LDAP) can still log in. If suspended while using Neo4j, they retain the roles and the privileges assigned by the external provider, including the
PUBLICrole. To prevent any of these, you need to use the mechanisms of their identity provider. -
Users who authenticate and authorize against an external ID provider and have user auth providers set up cannot log into Neo4j. If suspended while using Neo4j, they lose all assigned roles and associated privileges, including the
PUBLICrole, until reactivated.
-
User management command syntax
|
For more details about the syntax descriptions, see Database management command syntax. |
Command |
|
Syntax |
|
Description |
Lists the current user. When using the For more information, see Showing current user. |
Required privilege |
None. However, the
|
Command |
|
Syntax |
|
Description |
Lists all users. When using the For more information, see Showing users. |
Required privilege |
For more information, see DBMS USER MANAGEMENT privileges.
The
|
Command |
|
Syntax |
|
Description |
Lists the privileges granted to the specified users or the current user if no user is specified. When using the The |
Required privilege |
For more information, see DBMS PRIVILEGE MANAGEMENT privileges.
For more information, see DBMS USER MANAGEMENT privileges. |
Command |
|
||
Syntax |
|
||
Description |
Creates a new user.
For more information, see Creating users. |
||
Required privilege |
For more information, see Grant privilege to create users.
The
|
Command |
|
||
Syntax |
|
||
Description |
Creates a new user, or if a user with the same name exists, replace it.
For more information, see Creating users. |
||
Required privilege |
For more information, see Grant privilege to create users.
For more information, see Grant privilege to delete users.
The
|
Command |
|
Syntax |
|
Description |
Changes the name of a user. For more information, see Renaming users. |
Required privilege |
For more information, see DBMS USER MANAGEMENT privileges. |
Command |
|
Syntax |
|
Description |
Modifies the settings for an existing user.
|
Required privilege |
For more information, see DBMS USER MANAGEMENT privileges.
Introduced in 2026.06 Enterprise Edition The |
Enterprise Edition Introduced in 2026.06
Command |
|
Syntax |
|
Description |
Modifies the tags of several existing users in a single command.
For more information, see Modifying multiple users' tags. |
Required privilege |
For more information, see DBMS USER MANAGEMENT privileges.
For more information, see Grant privilege to set user metadata. |
Command |
|
Syntax |
|
Description |
Changes the current user’s password. For more information, see Changing the current user’s password. |
Required privilege |
None |
Command |
|
Syntax |
|
Description |
Removes an existing user. For more information, see Delete users. |
Required privilege |
For more information, see Grant privilege to delete users. |
Enterprise Edition
The |
Showing current user
You can view the currently logged-in user using the Cypher command SHOW CURRENT USER.
It produces a table with the following columns:
| Column | Description | Type | Community Edition | Enterprise Edition |
|---|---|---|---|---|
user |
User name |
|
||
roles |
Roles granted to the user. It returns |
|
||
passwordChangeRequired |
If |
|
||
suspended |
If It returns |
|
||
home |
The home database configured by the user, or It returns |
|
||
tags |
Enterprise Edition Introduced in 2026.06 The ABAC tags attached to the user.
This column is returned only by Seeing the tag values requires the It returns |
|
SHOW CURRENT USER;
| user | roles | passwordChangeRequired | suspended | home |
|---|---|---|---|---|
|
|
|
|
|
Rows: 1 |
||||
|
This command is only supported for a logged-in user and returns an empty result if authorization has been disabled. |
Showing users
You can list all available users using the Cypher command SHOW USERS.
It produces a table containing a single row per user with the following columns:
| Column | Description | Type | Community Edition | Enterprise Edition |
|---|---|---|---|---|
user |
User name |
|
||
roles |
Native roles granted to the user using the The set of roles a user receives in practice may differ from those in this column. It depends on DMBS configuration and the user’s auth providers. For example, if they use external (e.g. LDAP or OIDC) auth, or if It returns |
|
||
passwordChangeRequired |
If |
|
||
suspended |
If It returns |
|
||
home |
The home database configured for the user, otherwise It returns |
|
||
tags |
Enterprise Edition Introduced in 2026.06 The ABAC tags attached to the user.
This column is returned only by Seeing the tag values requires the It returns |
|
|
When first starting a Neo4j DBMS, there is always a single default user |
Show all users
SHOW USERS;
| user | roles | passwordChangeRequired | suspended | home |
|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
Rows: 2 |
||||
Show user with column reorder and filtering
This example shows how to:
-
Reorder the columns using a
YIELDclause. -
Filter the results using a
WHEREclause.
SHOW USER YIELD user, suspended, passwordChangeRequired, roles, home
WHERE user = 'jake';
| user | suspended | passwordChangeRequired | roles | home |
|---|---|---|---|---|
|
|
|
|
|
Rows: 1 |
||||
Show user with RETURN clause
It is possible to add a RETURN clause to further manipulate the results after filtering.
In this example, the RETURN clause is used to filter out the roles column and rename the user column to adminUser.
SHOW USERS YIELD roles, user
WHERE 'admin' IN roles
RETURN user AS adminUser;
| adminUser |
|---|
|
Rows: 1 |
Show users with their tagsEnterprise EditionIntroduced in 2026.06
The tags column is not part of the default output of SHOW USERS.
It is returned by SHOW USERS YIELD *, or when the tags column is yielded explicitly.
Assuming jake has been assigned the tags finance and auditor (tags are managed using the ALTER USER command):
SHOW USERS YIELD user, roles, tags;
| user | roles | tags |
|---|---|---|
|
|
|
|
|
|
Rows: 2 |
||
|
Seeing the values in the |
Showing user auth providers
To inspect available user auth providers, use SHOW USERS WITH AUTH.
The command produces a row per user per auth provider and yields the following two columns in addition to those output by SHOW USERS:
| Column | Description | Type | Community Edition | Enterprise Edition |
|---|---|---|---|---|
provider |
The name of the auth provider. |
|
||
auth |
A map containing configuration for the user.
For example, dn of the user for an |
|
Show users with auth
SHOW USERS WITH AUTH;
| user | roles | passwordChangeRequired | suspended | home | provider | auth |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rows: 3 |
||||||
Show user with auth using filtering
Show all users with the oidc auth provider.
SHOW USERS WITH AUTH
WHERE provider = 'oidc1';
| user | roles | passwordChangeRequired | suspended | home | provider | auth |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Rows: 1 |
||||||
For more information about auth providers, see User auth providers.
Creating users
You can create users using one of the following Cypher commands, depending on whether you want to create a new user or replace an existing one.
In both cases, you can specify the user’s password, whether they must change it at the next login, their status, home database, and auth provider settings.
The SET clauses can be applied in any order.
It is mandatory to specify a SET PASSWORD and/or at least one SET AUTH clause because users must have at least one auth provider.
CREATE USER syntax
CREATE USER name [IF NOT EXISTS] (1)
[SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'] (2)
[[SET PASSWORD] CHANGE [NOT] REQUIRED] (3)
[SET STATUS {ACTIVE \| SUSPENDED}] (4)
[SET HOME DATABASE name] (5)
[SET AUTH [PROVIDER] 'provider' "{"{SET <key> <value>}..."}"]... (6)
[SET TAG[S] tag[, ...]] (7)
CREATE OR REPLACE USER syntax
CREATE OR REPLACE USER name (1)
[SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'] (2)
[[SET PASSWORD] CHANGE [NOT] REQUIRED] (3)
[SET STATUS {ACTIVE \| SUSPENDED}] (4)
[SET HOME DATABASE name] (5)
[SET AUTH [PROVIDER] 'provider' "{"{SET <key> <value>}..."}"]... (6)
[SET TAG[S] tag[, ...]] (7)
Where:
| 1 | Specifies the command to create a user. |
| 2 | Specifies the password for the user.
The 'password' can either be a string value or a string parameter with default value length of at least 8 characters.The PLAINTEXT and ENCRYPTED keywords are optional and can be used to specify the format of the password, i.e. whether Neo4j needs to hash it or it has already been hashed.
By default, all passwords are encrypted (hashed) when stored in the Neo4j system database.
|
| 3 | Specifies whether the user must change their password at the next login.
If the optional SET PASSWORD CHANGE [NOT] REQUIRED is omitted but a password is given, the default is CHANGE REQUIRED.
The SET PASSWORD prefix of the CHANGE [NOT] REQUIRED clause is only optional if it directly follows the SET PASSWORD 'password' clause and is not part of a SET AUTH clause. |
| 4 | Specifies the user’s status.
If not set, the default is ACTIVE. |
| 5 | Specifies a home database for a user. A home database is resolved if it is pointing to a database or a database alias. Constituents and shards are not supported. If no home database is set, the DBMS default database is used as the home database for that user. |
| 6 | One or more SET AUTH clause can be used to configure external auth providers, such as LDAP or OIDC, which define authentication/authorization providers for that user.
SET AUTH can also be used as an alternative way to set the native (password-based) auth settings like SET PASSWORD and SET PASSWORD CHANGE REQUIRED.
For further informations, see the examples in this section, as well as Configure SSO at the user level using auth providers for OIDC, and Configure authentication/authorization at the user level using auth providers for LDAP.
|
| 7 | Introduced in 2026.06 Enterprise Edition One or more tags can be attached to the user with the SET TAG[S] clause.
The value is either a single string or a comma-separated list of strings.
Tags are arbitrary labels attached to the native user object that can be evaluated in attribute-based access control (ABAC) auth rules through the abac.native.user_tags() function.
ADD TAGS idempotently adds the specified tags to any existing tags, REMOVE TAGS idempotently removes the specified tags, and SET TAGS replaces any tags the user already has with the specified tags. |
|
Usernames are case sensitive.
The created user will appear on the list provided by
|
Create user with password, status, and home database
For example, you can create the user jake in a suspended state, with the home database anotherDb, and the requirement to change the password by using the command:
CREATE USER jake
SET PASSWORD 'abcd1234' CHANGE REQUIRED
SET STATUS SUSPENDED
SET HOME DATABASE anotherDb;
The equivalent command using the auth providers syntax would be:
CREATE USER jake
SET STATUS SUSPENDED
SET HOME DATABASE anotherDb
SET AUTH 'native' {SET PASSWORD 'abcd1234' SET PASSWORD CHANGE REQUIRED};
Create user with an encrypted password
You can create the user Jake in an active state, with an encrypted password (taken from the /data/scripts/databasename/restore_metadata.cypher of a restored database backup), and the requirement to not change the password by running:
CREATE USER Jake
SET ENCRYPTED PASSWORD '1,6d57a5e0b3317055454e455f96c98c750c77fb371f3f0634a1b8ff2a55c5b825,190ae47c661e0668a0c8be8a21ff78a4a34cdf918cae3c407e907b73932bd16c' CHANGE NOT REQUIRED
SET STATUS ACTIVE;
The equivalent command using the auth providers syntax would be:
CREATE USER jake
SET STATUS ACTIVE
SET AUTH 'native' {
SET ENCRYPTED PASSWORD '1,6d57a5e0b3317055454e455f96c98c750c77fb371f3f0634a1b8ff2a55c5b825,190ae47c661e0668a0c8be8a21ff78a4a34cdf918cae3c407e907b73932bd16c'
SET PASSWORD CHANGE NOT REQUIRED
};
Enterprise Edition
The |
The CREATE USER command is optionally idempotent, with the default behavior to throw an exception if the user already exists.
Appending IF NOT EXISTS to the CREATE USER command will ensure that no exception is thrown and nothing happens should the user already exist.
Create user if not exists
CREATE USER jake IF NOT EXISTS
SET PLAINTEXT PASSWORD 'abcd1234';
The equivalent command using the auth providers syntax would be:
CREATE USER jake IF NOT EXISTS
SET AUTH 'native' {SET PLAINTEXT PASSWORD 'abcd1234'};
The CREATE OR REPLACE USER command will result in any existing user being deleted and a new one created.
Create or replace user
CREATE OR REPLACE USER jake
SET PLAINTEXT PASSWORD 'abcd1234';
This is equivalent to running DROP USER jake IF EXISTS followed by CREATE USER jake SET PASSWORD 'abcd1234'.
The equivalent command using the auth providers syntax would be:
CREATE OR REPLACE USER jake
SET AUTH 'native' {SET PLAINTEXT PASSWORD 'abcd1234'};
Create a user with tagsEnterprise EditionIntroduced in 2026.06
For example, you can create the user jake and attach the tags finance and auditor, which can then be evaluated in ABAC auth rules:
CREATE USER jake
SET PASSWORD 'abcd1234'
SET TAGS 'finance', 'auditor';
|
The |
Renaming users
Users can be renamed with the RENAME USER command.
RENAME USER jake TO bob;
To verify the change, you can use the SHOW USERS command:
SHOW USERS;
| user | roles | passwordChangeRequired | suspended | home |
|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
Rows: 2 |
||||
|
The |
Modifying users
You can modify users with the ALTER USER command.
The command allows you to change the user’s password, status, home database, auth provider settings, and tags.
Within each group, the REMOVE, ADD, and SET clauses can be applied in any order.
However, all REMOVE clauses must come before any ADD clause, which in turn must come before the first SET clause, and at least one SET, ADD, or REMOVE clause is required for the command.
If any of the SET, ADD, or REMOVE clauses are omitted, the corresponding settings will not be changed.
ALTER USER syntax
ALTER USER name [IF EXISTS] (1)
[REMOVE HOME DATABASE] (2)
[REMOVE { AUTH [PROVIDER[S]] provider[, ...] \| ALL AUTH [PROVIDER[S]] }]... (3)
[REMOVE { TAG[S] tag[, ...] \| ALL TAG[S] }]... (4)
[ADD TAG[S] tag[, ...]]... (5)
[SET [PLAINTEXT | ENCRYPTED] PASSWORD 'password'] (6)
[[SET PASSWORD] CHANGE [NOT] REQUIRED] (7)
[SET STATUS {ACTIVE | SUSPENDED}] (8)
[SET HOME DATABASE name] (9)
[SET AUTH [PROVIDER] 'provider' "{"{SET <key> <value>}..."}"]... (10)
[SET TAG[S] tag[, ...]] (11)
Where:
| 1 | Specifies the command to alter a user. |
| 2 | Removes the home database for the user. As a result, the DBMS default database will be used as the home database for that user. |
| 3 | Removes one, several, or all existing auth provider(s) from a user.
However, a user must always have at least one auth provider.
Therefore, REMOVE ALL AUTH must be used in conjunction with at least one SET AUTH clause in order to meet this requirement. |
| 4 | Introduced in 2026.06 Enterprise Edition Removes one, several, or all existing tags from the user.
Use REMOVE TAG[S] tag[, …] to remove specific tags, or REMOVE ALL TAG[S] to remove every tag from the user.
Removing a tag that the user does not have has no effect. |
| 5 | Introduced in 2026.06 Enterprise Edition Adds one or more tags to the user, keeping any existing tags. The value is either a single string or a comma-separated list of strings. |
| 6 | Specifies the password for the user.
The 'password' can either be a string value or a string parameter with default value length of at least 8 characters.The PLAINTEXT and ENCRYPTED keywords are optional and can be used to specify the format of the password, i.e. whether Neo4j needs to hash it or it has already been hashed.
By default, all passwords are encrypted (hashed) when stored in the Neo4j system database.
|
| 7 | Specifies whether the user must change their password at the next login.
If the optional SET PASSWORD CHANGE [NOT] REQUIRED is omitted when adding native auth to a user (either by first removing pre-existing native auth or if the user does not have native auth to start with), the default is CHANGE REQUIRED.
The SET PASSWORD prefix of the CHANGE [NOT] REQUIRED clause is only optional if it directly follows the SET PASSWORD 'password' clause and is not part of a SET AUTH clause. |
| 8 | Specifies the user’s status. |
| 9 | Specifies a home database for a user. A home database is resolved if it is pointing to a database or a database alias. If no home database is set, the DBMS default database is used as the home database for that user. |
| 10 | One or more SET AUTH clauses can be used to set auth providers, which define authentication / authorization providers for that user.
This might be used to configure external auth providers like LDAP or OIDC, but can also be used as an alternative way to set the native (password-based) auth settings like SET PASSWORD and SET PASSWORD CHANGE REQUIRED.
For further informations, see the examples in this section, as well as Configure SSO at the user level using auth providers, and Configure authentication/authorization at the user level using auth providers.
|
| 11 | Introduced in 2026.06 Enterprise Edition Sets the user’s tags, replacing any tags the user already has.
To add tags without removing existing ones, use the ADD TAG[S] clause instead.
Tags can be evaluated in attribute-based access control (ABAC) auth rules using the abac.native.user_tags() function. |
Modify a user’s password and status
For example, you can modify the user bob by setting a new password and active status, and removing the requirement to change his password by running:
ALTER USER bob
SET PASSWORD 'abcd5678' CHANGE NOT REQUIRED
SET STATUS ACTIVE;
The equivalent command using the auth providers syntax would be:
ALTER USER bob
SET AUTH 'native' {SET PASSWORD 'abcd5678' SET PASSWORD CHANGE NOT REQUIRED}
SET STATUS ACTIVE;
Modify a user to expire their current password
For example, you can modify the user bob to expire his current password so that he must change it the next time he logs in:
ALTER USER bob
SET PASSWORD CHANGE REQUIRED;
The equivalent command using the auth providers syntax would be:
ALTER USER bob
SET AUTH 'native' {SET PASSWORD CHANGE REQUIRED};
Modify a user to use an external OIDC auth providerEnterprise Edition
For example, you can modify the user bob by removing his native auth provider and adding an external OIDC auth provider:
ALTER USER bob
REMOVE AUTH 'native'
SET AUTH 'oidc-mysso1' {SET ID 'bobsUniqueMySso1Id'};
Modify a user to use multiple external OIDC auth providersEnterprise Edition
For example, you can modify the user bob by removing all of his existing auth providers and adding two external OIDC auth providers:
ALTER USER bob
REMOVE ALL AUTH
SET AUTH 'oidc-mysso1' {SET ID 'bobsUniqueMySso1Id'}
SET AUTH 'oidc-mysso2' {SET ID 'bobsUniqueMySso2Id'};
Assign a user a different home database
For example, you can modify the user bob by assigning him a different home database:
ALTER USER bob
SET HOME DATABASE anotherDbOrAlias;
Remove the home database from a user and set their status to suspended
For example, you can modify the user bob by removing his home database and setting his status to suspended:
ALTER USER bob
REMOVE HOME DATABASE
SET STATUS SUSPENDED;
Add and remove tags on a userEnterprise EditionIntroduced in 2026.06
For example, you can modify the user bob by adding the on-call tag while removing the auditor tag:
ALTER USER bob
REMOVE TAG 'auditor'
ADD TAG 'on-call';
|
Any |
Replace all of a user’s tagsEnterprise EditionIntroduced in 2026.06
SET TAGS replaces whatever tags the user currently has.
For example, you can replace bob tags with exactly finance and auditor:
ALTER USER bob
SET TAGS 'finance', 'auditor';
Instead of removing every tag from a user, use REMOVE ALL TAGS, for example ALTER USER bob REMOVE ALL TAGS.
|
When altering a user, it is only necessary to specify the changes required.
For example, leaving out the |
Enterprise Edition
The |
The changes to the user will appear on the list provided by SHOW USERS.
To see the tags set, use SHOW USERS YIELD * to explicitly yield the tags column.
The tags column is not part of the default output of SHOW USERS.
SHOW USERS YIELD *;
| user | roles | passwordChangeRequired | suspended | home | tags |
|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Rows: 2 |
|||||
|
Introduced in 2026.06 Seeing the values in the |
The default behavior of this command is to throw an exception if the user does not exist.
Adding an optional parameter IF EXISTS to the command makes it idempotent and ensures that no exception is thrown.
Nothing happens should the user not exist.
ALTER USER nonExistingUser IF EXISTS SET PASSWORD 'abcd1234';
Modifying multiple users' tagsEnterprise EditionIntroduced in 2026.06
You can modify the tags of several users in a single command with the ALTER USERS command.
This is useful for applying the same tag changes across a group of users without issuing a separate ALTER USER command for each one.
ALTER USERS syntax
ALTER USERS name[, ...] [IF EXISTS] (1)
[REMOVE { TAG[S] tag[, ...] \| ALL TAG[S] }]... (2)
[ADD TAG[S] tag[, ...]]... (3)
[SET TAG[S] tag[, ...]] (4)
Where:
| 1 | Specifies the command to alter one or more users, given as a comma-separated list of usernames.
By default, the command throws an exception if any of the listed users do not exist.
Adding the optional IF EXISTS makes the command idempotent, so no exception is thrown and the missing users are skipped. |
| 2 | Removes one, several, or all existing tags from each listed user.
Use REMOVE TAG[S] tag[, …] to remove specific tags, or REMOVE ALL TAG[S] to remove every tag. |
| 3 | Adds one or more tags to each listed user, keeping any existing tags. |
| 4 | Sets the tags of each listed user, replacing any tags they already have. |
As with ALTER USER, any REMOVE clause(s) must come before any ADD clause(s), which must come before any SET clause(s), and at least one SET, ADD, or REMOVE clause is required.
The tags can be evaluated in attribute-based access control (ABAC) auth rules through the abac.native.user_tags() function.
Changing the current user’s password
Users can change their password using ALTER CURRENT USER SET PASSWORD.
The old password is required in addition to the new one, and either or both can be a string value or a string parameter.
When a user executes this command it will change their password as well as set the CHANGE NOT REQUIRED flag.
ALTER CURRENT USER
SET PASSWORD FROM 'password1' TO 'password2';
|
This command works only for a logged-in user and cannot be run with auth disabled. |
Delete users
Users can be deleted with DROP USER.
DROP USER bob;
Deleting a user does not automatically terminate associated connections, sessions, transactions, or queries.
However, when a user is deleted, it no longer appears on the list provided by SHOW USERS:
SHOW USERS;
| user | roles | passwordChangeRequired | suspended | home |
|---|---|---|---|---|
|
|
|
|
|
Rows: 1 |
||||