MariaDB 开启密码复杂度审计和密码过期

#安装启用
INSTALL SONAME 'simple_password_check';
#检查验证
show variables like '%password%';
+-----------------------------------------+-------+
| Variable_name                           | Value |
+-----------------------------------------+-------+
| default_password_lifetime               | 30    |
| disconnect_on_expired_password          | OFF   |
| max_password_errors                     | 5     |
| old_passwords                           | OFF   |
| report_password                         |       |
| simple_password_check_digits            | 1     |
| simple_password_check_letters_same_case | 1     |
| simple_password_check_minimal_length    | 8     |
| simple_password_check_other_characters  | 1     |
| strict_password_validation              | ON    |
+-----------------------------------------+-------+

配置文件设置方式

[mysqld]
#加载密码复杂度审计插件
plugin-load=simple_password_check.so
#密码长度,默认8位
simple_password_check_minimal_length=8
#特殊符号,1代表至少1位
simple_password_check_other_characters=1
#字母数,1代表至少1位
simple_password_check_letters_same_case=1
#数字数,1代表至少1位
simple_password_check_digits=1
#默认密码过期时间 单位天 每过180天就要修改密码
default_password_lifetime=180
#最大错误登录次数
max_password_errors=5

 

posted @ 2022-10-12 14:24  缤纷世界  阅读(896)  评论(0)    收藏  举报