mysql 8/oracle 登录失败处理,应配置并启用结束会话、限制非法登录次数和当登录连接超时自动退出等相关措施

1 mysql 8

先安装密码插件

install plugin CONNECTION_CONTROL soname 'connection_control.so';
install plugin CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS soname 'connection_control.so';

设置

SET GLOBAL connection_control_failed_connections_threshold = 5; ## 失败尝试次数为:5次
SET GLOBAL connection_control_min_connection_delay = 20000; ## 单位默认为毫秒, 设置为:20秒
SET GLOBAL connection_control_max_connection_delay = 30000; ## 单位默认为毫秒,设置为:30秒

2 oracle

2.1 oracle 设置登录失败处理

oracle连续登录失败10次锁定账号

select * from dba_profiles t where t
resource_name='FAILED_LOGIN_ATTEMPTS';
alter profile default limit FAILED_LOGIN_ATTEMPTS 10;
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;

2.2 oracle  设置会话超时时间 

 

create profile my_profile limit idle_time 50;--50分钟

alter user username profile my_profile;

posted @ 2022-12-01 15:31  老街巷口熟睡的猫  阅读(1171)  评论(0编辑  收藏  举报