passwordcheck.enable 密码复杂度开关,默认为关闭状态。
\c - sso
show passwordcheck.enable;
passwordcheck.enable
----------------------
off
(1 行记录)
alter system set passwordcheck.enable=on;
ALTER SYSTEM
select sys_reload_conf();
sys_reload_conf
-----------------
t
(1 行记录)
show passwordcheck.enable;
passwordcheck.enable
----------------------
on
(1 行记录)
passwordcheck.password_length 口令的最小长度,取值范围为 [8,63],缺省为8。
\c - sso
SHOW passwordcheck.password_length;
passwordcheck.password_length
-------------------------------
8
(1 row)
alter system SET passwordcheck.password_length = 10;
select sys_reload_conf();
SHOW passwordcheck.password_length;
passwordcheck.password_length
-------------------------------
10
(1 row)
\c - system
CREATE USER u_pwd PASSWORD '123ab';
ERROR: password length 5 is too short, should be longer than min
password length 10.
CREATE USER u_pwd PASSWORD '1234567890ab';
CREATE ROLE
passwordcheck.password_condition_letter 口令至少包含几个字母,取值范围为[2,61],缺省为2。
\c - sso
SHOW passwordcheck.password_condition_letter;
passwordcheck.password_condition_letter
-----------------------------------------
2
(1 row)
alter system SET passwordcheck.password_condition_letter = 3;
select sys_reload_conf();
SHOW passwordcheck.password_condition_letter;
passwordcheck.password_condition_letter
-----------------------------------------
3
(1 row)
\c - system
ALTER USER u_pwd PASSWORD '1234567890';
ERROR: Password should contain at least 3 letter and the current
number is 0
ALTER USER u_pwd PASSWORD '1234567890ab';
ERROR: Password should contain at least 3 letter and the current
number is 2
ALTER USER u_pwd PASSWORD '1234567890abC';
ALTER ROLE
passwordcheck.password_condition_digit 口令至少包含几个数字,取值范围为 [2,61],缺省为2。
\c - sso
SHOW passwordcheck.password_condition_digit;
passwordcheck.password_condition_digit
----------------------------------------
2
(1 row)
alter system SET passwordcheck.password_condition_digit = 3;
select sys_reload_conf();
SHOW passwordcheck.password_condition_digit;
passwordcheck.password_condition_digit
----------------------------------------
3
(1 row)
\c - system
ALTER USER u_pwd PASSWORD 'abcdefghij';
ERROR: Password should contain at least 3 digit and the current
number is 0
ALTER USER u_pwd PASSWORD 'abcdefghij123';
ALTER ROLE
passwordcheck.password_condition_punct 口令至少包含几个特殊字符,取值范围为 [0,59],缺 省为 0。其中特殊符号为除空白符、英文字母、单引号和数字外的所有可见字符。
\c - sso
SHOW passwordcheck.password_condition_punct;
passwordcheck.password_condition_punct
----------------------------------------
0
(1 row)
alter system SET passwordcheck.password_condition_punct = 2;
select sys_reload_conf();
SHOW passwordcheck.password_condition_punct;
passwordcheck.password_condition_punct
----------------------------------------
2
(1 row)
\c - system
ALTER USER u_pwd PASSWORD '1234567890abc.';
ERROR: Password should contain at least 2 punct and the current
number is 1
ALTER USER u_pwd PASSWORD '1234567890abc./';
ALTER ROLE