content/operate/rs/security/access-control/manage-passwords/password-complexity-rules.md
Redis Software provides optional password complexity rules that meet common requirements. When enabled, these rules require the password to have:
These requirements reflect v6.2.12 and later. Earlier versions did not support numbers or special characters as the first or the last character of a password. This restriction was removed in v6.2.12.
In addition, the password:
Password complexity rules apply when a new user account is created and when the password is changed. Password complexity rules are not applied to accounts authenticated by an external identity provider.
To enable password complexity rules, use one of the following methods:
Cluster Manager UI:
Go to Cluster > Security > Preferences, then select Edit.
In the Password section, enable Complexity rules.
Select Save.
[Update cluster]({{<relref "/operate/rs/references/rest-api/requests/cluster#put-cluster">}}) REST API request:
PUT https://[host][:port]/v1/cluster
{ "password_complexity": true }
When password complexity rules are enabled, passwords must have at least 8 characters by default.
If you change the minimum password length, the new minimum is enforced for new users and when existing users change their passwords.
To change the minimum password length, use one of the following methods:
Cluster Manager UI:
Go to Cluster > Security > Preferences.
Click Edit.
In the Password section, enable Complexity rules.
Set the number of characters for Minimum password length.
{{<image filename="images/rs/screenshots/cluster/security-preferences-min-password-length.png" alt="The minimum password length setting appears in the password section of the cluster security preferences screen when complexity rules are enabled." >}}
Click Save.
[Update cluster]({{<relref "/operate/rs/references/rest-api/requests/cluster#put-cluster">}}) REST API request:
PUT https://[host][:port]/v1/cluster
{ "password_min_length": <integer between 8-256> }
To deactivate password complexity rules, use one of the following methods:
Cluster Manager UI:
Go to Cluster > Security > Preferences, then select Edit.
In the Password section, turn off Complexity rules.
Select Save.
[Update cluster]({{<relref "/operate/rs/references/rest-api/requests/cluster#put-cluster">}}) REST API request:
PUT https://[host][:port]/v1/cluster
{ "password_complexity": false }