暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

数据猿 2022-02-22
667

 

关键字

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



「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论