passwordcheck
checks user passwords and reject weak password
Repository
https://www.postgresql.org/docs/current/passwordcheck.html
https://www.postgresql.org/docs/current/passwordcheck.html
Source
passwordcheck_cracklib-3.1.0.tar.gz
passwordcheck_cracklib-3.1.0.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
passwordcheck | - | SEC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 7990 | passwordcheck | No | Yes | Yes | No | No | No | - |
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| - | - | - | - | - |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
passwordcheck validates password strength whenever passwords are set using CREATE ROLE or ALTER ROLE. Weak passwords are rejected with an error.
Configuration
Add to postgresql.conf:
Configuration Parameters
| Parameter | Default | Description |
|---|---|---|
passwordcheck.min_password_length | 8 | Minimum password length in bytes (superuser only) |
How It Works
The module checks passwords set via CREATE ROLE or ALTER ROLE:
Default Checks
Without CrackLib, the module enforces:
- Minimum password length (configurable via
passwordcheck.min_password_length) - Password must not be the username
- Basic complexity requirements
Limitations
- Pre-encrypted passwords sent by client programs cannot be fully validated
- The module can only guess the actual password from encrypted submissions
- For stronger security, consider external authentication methods (e.g., GSSAPI)
- No
CREATE EXTENSIONis required – this is a shared library module only
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)