CentOS7设置用户密码规则

原文地址:https://blog.csdn.net/wh211212/article/details/79979062

出于安全原因设置密码规则

1、设置密码过期的天数。 用户必须在几天内更改密码。 此设置仅在创建用户时才会产生影响,而不会影响到现有用户。 如果设置为现有用户,请运行命令“chage -M(days)(user)”

[root@shaonbean ~]# vi /etc/login.defs
# line 25: set 60 for Password Expiration
PASS_MAX_DAYS 60

2、设置可用密码的最短天数。 至少在改变它之后,用户必须至少使用他们的密码。 此设置仅在创建用户时才会产生影响,而不会影响到现有用户。 如果设置为现有用户,请运行命令“chage -m(days)(user)”

[root@shaonbean ~]# vi /etc/login.defs
# line 26: set 2 for Minimum number of days available
PASS_MIN_DAYS 2

3、在到期前设置警告的天数。 此设置仅在创建用户时才会产生影响,而不会影响到现有用户。 如果设置为存在用户,请运行命令“chage -W(days)(user)”

[root@shaonbean ~]# vi /etc/login.defs
# line 28: set 7 for number of days for warnings
PASS_WARN_AGE 7

4、使用过去使用的密码进行限制。 在这一代中,用户不能设置相同的密码。

[root@shaonbean ~]# vi /etc/pam.d/system-auth
# near line 15: prohibit to use the same password for 5 generation in past
password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5

5、设置最小密码长度。 用户不能将密码长度设置为小于此参数。

# set 8 for minimum password length
[root@shaonbean ~]# authconfig --passminlen=8 --update
# the parameter is set in a config below
[root@shaonbean ~]# grep "^minlen" /etc/security/pwquality.conf 
minlen = 8

6、为新密码设置所需的最少字符类数。 (种类⇒UpperCase / LowerCase / Digits / Others)

# set 2 for minimum number of required classes of characters
[root@shaonbean ~]# authconfig --passminclass=2 --update
# the parameter is set in a config below
[root@shaonbean ~]# grep "^minclass" /etc/security/pwquality.conf 
minclass = 2

7、在新密码中设置允许的连续相同字符的最大数量。

# set 2 for maximum number of allowed consecutive same characters
[root@shaonbean ~]# authconfig --passmaxrepeat=2 --update
# the parameter is set in a config below
[root@shaonbean ~]# grep "^maxrepeat" /etc/security/pwquality.conf 
maxrepeat = 2

8、在新密码中设置同一类的最大允许连续字符数。


# set 4 for maximum number of allowed consecutive characters of the same class
[root@shaonbean ~]# authconfig --passmaxclassrepeat=4 --update
# the parameter is set in a config below
[root@shaonbean ~]# grep "^maxclassrepeat" /etc/security/pwquality.conf 
maxclassrepeat = 4

9、新密码中至少需要一个小写字符

[root@shaonbean ~]# authconfig --enablereqlower --update
# the parameter is set in a config below
# (if you'd like to edit the value, edit it with vi and others)
[root@shaonbean ~]# grep "^lcredit" /etc/security/pwquality.conf 
lcredit = -1

10、新密码中至少需要一个大写字符

[root@shaonbean ~]# authconfig --enablerequpper --update
# the parameter is set in a config below
# (if you'd like to edit the value, edit it with vi and others)
[root@shaonbean ~]# grep "^ucredit" /etc/security/pwquality.conf 
ucredit = -1

11、新密码中至少需要一位数字

[root@shaonbean ~]# authconfig --enablereqdigit --update
# the parameter is set in a config below
# (if you'd like to edit the value, edit it with vi and others)
[root@shaonbean ~]# grep "^dcredit" /etc/security/pwquality.conf 
dcredit = -1

12、新密码中至少需要一个其他字符

[root@shaonbean ~]# authconfig --enablereqother --update
# the parameter is set in a config below
# (if you'd like to edit the value, edit it with vi and others)
[root@shaonbean ~]# grep "^ocredit" /etc/security/pwquality.conf 
ocredit = -1

13、在新密码中设置单调字符序列的最大长度。 (ex⇒’12345’,’fedcb’)

[root@shaonbean ~]# vi /etc/security/pwquality.conf
# add to the end
maxsequence = 3

14、设置旧密码中不能出现的新密码中的字符数。

[root@shaonbean ~]# vi /etc/security/pwquality.conf
# add to the end
difok = 5

15、检查新密码中是否包含用户passwd项的GECOS字段中长度超过3个字符的单词

[root@shaonbean ~]# vi /etc/security/pwquality.conf
# add to the end
gecoscheck = 1

16、设置不能包含在密码中的Ssace分隔列表。


[root@shaonbean ~]# vi /etc/security/pwquality.conf
# add to the end
badwords = denywords1 denywords2 denywords3

17、为新密码设置散列/密码算法。 (默认是sha512)

# show current algorithm
[root@shaonbean ~]# authconfig --test | grep hashing 
password hashing algorithm is md5
# chnage algorithm to sha512
[root@shaonbean ~]# authconfig --passalgo=sha512 --update
[root@shaonbean ~]# authconfig --test | grep hashing 
password hashing algorithm is sha512

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
简介: 4 一:安装配置环境介绍 5 1:系统版本: 5 2:内核版本: 5 3:ceph版本: 5 4:ceph-deploy版本: 5 4:网络拓扑图 6 5:设备位置图 6 6:服务器配置信息及运行服务统计 7 二:系统软件基础包初始化: 10 1:安装 EPEL 软件源: 10 2:常用软件包、常用工具等(非必须、推荐安装) 10 三:集群主机系统初始化准备 10 1:规范系统主机名; 11 2:添加hosts文件实现集群主机名与主机名之间相互能够解析 11 3:每台 ssh-copy-id 完成这些服务器之间免ssh密码登录; 11 4:关闭防火墙或者开放 6789/6800~6900端口、关闭SELINUX; 11 5:关闭防火墙及开机启动 12 5:配置ntp服务,保证集群服务器时间统一; 12 6:系统优化类 12 四:集群优化配置 12 1:优化前提 12 2: 开启VT和HT 13 3:关闭CPU节能 13 4:关闭NUMA 13 5:网络优化 15 6:修改read_ahead 15 7:关闭swap 16 8:调整Kernel pid max 16 9:修改I/O Scheduler 16 五:安装部署主机(ceph-deploy)安装环境准备 17 1:建立主机列表 17 2:为所有集群主机创建一个 ceph 工作目录 17 3:同步hosts文件 17 4:测试主机名解析 17 5:ceph-deploy安装配置 18 六:创建mon 节点 18 1:安装部署集群软件包: 18 2:在安装部署节使用ceph-deploy创建,生成MON信息: 18 3:添加初始monitor节点和收集秘钥 18 4:验证集群mon节点安装成功 19 七:安装集群osd服务 19 1:查看一下 Ceph 存储节点的硬盘情况: 19 2:批量格式化磁盘 20 3:执行osd初始化命令 21 4:验证日志写入位置在ssd 硬盘分区成功 22 5:验证osd启动状态 22 6:PGs per OSD (2 < min 30)报错解决: 23 7:官方推荐pg计算公式 24 八:添加元数据服务器 24 1:添加元数据服务器 24 2:验证mds服务 24 3:删除mds节点 26 4:同步集群配置文件 26 九:crush 规则配置 26 1:ceph crush规则介绍 26 2:集群crush规则配置 27 3:修改crushmap信息 28 十:集群配置清理 29 1:清理软件包 29 2:卸载之前挂载的osd磁盘 29 3:将写入分区表的分区挂载 29 4:查看一下状态,仅剩余系统盘 30 5:清理残余key文件和残余目录 30 6:新建安装目录 30 7:重新部署集群 30 十一:集群配置参数优化 30 1:配置参数优化 30 2:同步集群配置文件 49 十二:ceph集群启动、重启、停止 49 1:ceph 命令的选项 49 2:启动所有守护进程 50 3:启动单一实例 50 十三:维护常用命令 50 1:检查集群健康状况 50 1:检查集群健康状况 50 2:检查集群的使用情况 51 3:检查集群状态 51 4:检查MONITOR状态 52 5:检查 MDS 状态: 52 十四:集群命令详解 52 1:mon 相关 52 2: msd 相关 53 4:ceph auth 相关 54 5:osd 相关 54 6:pool 相关 56 7:rados命令相关 57 8:PG 相关 59 9: rbd命令相关 61 十五:ceph 日志和调试设置 63 1:配置文件修改 63 2:在线修改日志输出级别 63 3:修改集群子系统,日志和调试设置 64 4:日志输出级别默认值 65

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值