麒麟KYSEC使用方法06-命令设置账户锁定

206 篇文章 2 订阅
206 篇文章 3 订阅

原文链接:麒麟KYSEC使用方法06-命令设置账户锁定
hello,大家好啊,今天给大家带来麒麟KYLINOS的kysec使用方法系列文章第六篇内容----使用命令设置账户锁定,账户锁定策略有一个文件需要修改,common-auth,今天给大家介绍一下使用命令设置账户锁定的文章,欢迎大家点个赞并点个在看。关注我吧!

1、查看系统信息

pdsyw@pdsyw-pc:~/桌面$ sudo -i
root@pdsyw-pc:~# 
root@pdsyw-pc:~# cat /etc/.kyinfo 
[dist]
name=Kylin
milestone=Desktop-V10-SP1-General-Release-2303
arch=arm64
beta=False
time=2023-04-27 15:46:53
dist_id=Kylin-Desktop-V10-SP1-General-Release-2303-arm64-2023-04-27 15:46:53

[servicekey]
key=0516013

[os]
to=
term=2024-08-01

root@pdsyw-pc:~# uname -a
Linux pdsyw-pc 5.4.18-85-generic #74-KYLINOS SMP Fri Mar 24 11:20:19 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
root@pdsyw-pc:~# 

image.png

2、查看common-auth原文件

root@pdsyw-pc:~# cat /etc/pam.d/common-auth
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
auth	[success=3 default=ignore]	pam_biometric.so 
auth	[success=2 default=ignore]	pam_unix.so nullok_secure try_first_pass pwquality deny=5 unlock_time=180 root_unlock_time=180
auth	[success=1 default=ignore]	pam_sss.so use_first_pass
# here's the fallback if no module succeeds
auth	requisite			pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth	required			pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config
root@pdsyw-pc:~# 

image.png

3、查看账户锁定的策略情况
image.png

4、更改密码连续输错次数为10次

root@pdsyw-pc:~# sed -i 's/deny=5/deny=10/g'  /etc/pam.d/common-auth
root@pdsyw-pc:~# 
root@pdsyw-pc:~# grep deny  /etc/pam.d/common-auth
auth	[success=2 default=ignore]	pam_unix.so nullok_secure try_first_pass pwquality deny=10 unlock_time=180 root_unlock_time=180
auth	requisite			pam_deny.so
root@pdsyw-pc:~#

image.png

5、更改后的情况
image.png

6、更改账户锁定时间为5分钟

root@pdsyw-pc:~# sed -i 's/unlock_time=180/unlock_time=300/g'  /etc/pam.d/common-authroot@pdsyw-pc:~# 
root@pdsyw-pc:~# grep unlock_time  /etc/pam.d/common-auth
auth	[success=2 default=ignore]	pam_unix.so nullok_secure try_first_pass pwquality deny=10 unlock_time=300 root_unlock_time=300
root@pdsyw-pc:~# 

image.png

7、更改后的情况
image.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鹏大圣运维

编写不易,还请支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值