金仓数据库KingbaseES中如何设置口令策略

关键字

KingbaseES,口令策略

开启密码复杂度

1、编辑kingbase.conf文件,在shared_preload_libraries中加入passwordcheck:

shared_preload_libraries = ‘passwordcheck’

然后重启服务。

2、以SYSTEM用户登录数据库,创建扩展

TEST =# create extension passwordcheck;

CREATE EXTENSION

3、执行

TEST =# alter system set passwordcheck.enable = on;

ALTER SYSTEM



TEST =# show passwordcheck.enable;

 passwordcheck.enable

-------------------------

 off

(1行记录)



TEST =# call sys_reload_conf();

 sys_reload_conf()

-------------------------

 t

(1行记录)



TEST =# show passwordcheck.enable;

 passwordcheck.enable

-------------------------

 on

(1行记录)

查看口令默认长度

TEST =# show passwordcheck.password_length;

 passwordcheck.password_length

---------------------------------

 8

(1行记录)

查看口令默认包含几个字母

TEST =# show passwordcheck.password_condition_letter;

 passwordcheck.password_condition_letter

-------------------------------------------

 2

(1行记录)

查看口令默认包含几个数字

TEST =# show passwordcheck.password_condition_digit;

 passwordcheck.password_condition_digit

-------------------------------------------

 2

(1行记录)

示例

1、以SYSTEM 用户登录

2创建用户

TEST =# create user u1;

3、为用户设置密码

TEST =# alter user u1 with password '12345678ab';

4、system修改用户的密码

(1)密码为6位数字组成

TEST =# alter user u1 with password '123456';

错误:Password length 6 is too short, should be longer than min password length 8.

(2)密码为8位数字组成

TEST =# alter user u1 with password '12345678';

错误:Password should contain at least 2 letter and the current letter is 0.

(3)密码由数字+一位字母组成

TEST =# alter user u1 with password '12345678a';

错误:Password should contain at least 2 letter and the current letter is 1.

(4)密码由数字+二位以上字母组成

TEST =# alter user u1 with password '12345678abc';

ALTER ROLE

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值