linux限制用户密码尝试次数

作者: 2hei 发表于2009年7月 8日 22:46
版权声明: 可以转载, 转载时务必以超链形式标明文章原始出处和作者信息及版权声明
http://www.2hei.net/mt/2009/07/linux-pam-tally-use.html
设置方式:
vi /etc/pam.d/system-auth

auth        required      /lib/security/$ISA/pam_tally.so onerr=fail no_magic_root
account     required      /lib/security/$ISA/pam_tally.so deny=5 no_magic_root reset

#说明
deny=5 : Deny access if tally for this user exceeds 3 times.
lock_time=180 : Always deny for 180 seconds after failed attempt. There is also unlock_time=n option. It allow access after n seconds after failed attempt. If this option is used the user will be locked out for the specified amount of time after he exceeded his maximum allowed attempts. Otherwise the account is locked until the lock is removed by a manual intervention of the system administrator.
magic_root : If the module is invoked by a user with uid=0 the counter is not incremented. The sys-admin should use this for user launched services, like su, otherwise this argument should be omitted.
no_magic_root : Avoid root account locking, if the module is invoked by a user with uid=0

会有日志记录被锁定的用户
/var/log/faillog

清除被锁定的用户
crontab -l
*/30 * * * * /sbin/pam_tally --reset
或者
*/30 * * * * faillog -r
| | Comments (0) | TrackBacks (0)
本篇相关文章:

发表一个评论

关于这篇文章

这篇文章由2hei2009年7月 8日 22:46发布.

上一篇:Windows下安装 Lighttpd php fastcgi mysql环境

下一篇:ssh登陆到终端的时候去掉Your default context is root提示

回到首页 或者查看归档文章