麒麟KYSEC使用方法06-命令设置账户锁定
  zlFXOISLSFW7 2023年11月25日 15 0

往期好文:麒麟KYSEC使用方法05-命令设置密码强度

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:~#

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

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:~#

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

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

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

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:~#

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

5、更改后的情况

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

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:~#

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

7、更改后的情况

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

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月25日 0

暂无评论

推荐阅读
  6YY0QMPUXEwu   2023年12月10日   11   0   0 linux网卡
  nIt0XG0acU8j   2023年12月11日   13   0   0 linuxhtop
  nIt0XG0acU8j   2023年12月09日   16   0   0 linuxsort
zlFXOISLSFW7