是否有办法限制用户进行su尝试的次数?
例如,恶意用户进入具有su访问权限的用户登录名。反复运行su以获得超级用户访问权限。
这个例子将是一个罕见的事件,但似乎仍然是一个好主意,增加保护免受。
我在/etc/panam.d/su中添加了以下行来测试它:
auth required pam_faillock.so preauth silent audit deny=1 unlock_time=120
auth sufficient pam_unix.so nullok try_first_pass
auth [default=die] pam_faillock.so authfail audit deny=1 unlock_time=120
account required pam_faillock.so然而,它并没有把任何人锁在外面。我通过故障锁进行监视,我看到:
# faillock
user:
When Type Source Valid
root:
When Type Source Valid
2015-01-30 20:55:05 TTY pts/1 V
2015-01-30 20:55:20 TTY pts/1 V但是,这个条目在root下(那么它会为每个人锁定根用户吗?)这个条目对su没有影响。
发布于 2015-01-30 18:44:12
在谷歌上搜索到这份文件的结果如下:
Task: Set Maximum Number of Login Failures
The -m option is allows you to set maximum number of login failures after
the account is disabled to specific number called MAX. Selecting MAX value
of 0 has the effect of not placing a limit on the number of failed logins.
The maximum failure count should always be 0 for root to prevent a denial of
services attack against the system:
# faillog -M MAX -u username
# faillog -M 10 -u vivek和这份文件:
faillog
faillog -u <user> -r
faillog -u oracle -m 0
/var/log/faillog
faillog -u <user> -m -1但是,在faillog上执行CentOS7。根据这个问答,pam_tally2替换了faillog命令。
deny=n
Deny access if tally for this user exceeds n.https://serverfault.com/questions/663783
复制相似问题