admin管理员组

文章数量:1530069

项目场景:

昨天使用了usermod -e 2021-04-13 wherein 设置了用户wherein 的过期时间

问题描述:

今天直接登录ssh wherein@118.126.94.223就登录不上了

原因分析:

用法:chage [选项] 登录

选项:
  -d, --lastday 最近日期        将最近一次密码设置时间设为“最近日期”
  -E, --expiredate 过期日期     将帐户过期时间设为“过期日期”
  -h, --help                    显示此帮助信息并推出
  -I, --inactive INACITVE       过期 INACTIVE 天数后,设定密码为失效状态
  -l, --list                    显示帐户年龄信息
  -m, --mindays 最小天数        将两次改变密码之间相距的最小天数设为“最小天数”
  -M, --maxdays 最大天数        将两次改变密码之间相距的最大天数设为“最大天数”
  -R, --root CHROOT_DIR         chroot 到的目录
  -W, --warndays 警告天数       将过期警告天数设为“警告天数”
# 更改用户密码过期信息
[root@VM_110_26_centos ~]# chage -l wherein
Last password change					: Nov 07, 2019			# 最近一次修改密码的时间
Password expires					: never						# 密码过期时间
Password inactive					: never						# 密码失效时间
Account expires						: Apr 13, 2021				# 账户过期时间
Minimum number of days between password change		: 0			# 两次改变密码之间相距最小天数
Maximum number of days between password change		: 99999		# 两次密码改变密码相距最大天数
Number of days of warning before password expires	: 7			# 密码过期前开始警告的天数

解决方案:

直接设置长久的过期时间, 如n年后或n天后

[root@VM_110_26_centos ~]# usermod -e 2021-08-08 wherein

[root@VM_110_26_centos ~]# chage -l wherein
Last password change					: Nov 07, 2019
Password expires					: never
Password inactive					: never
Account expires						: Aug 08, 2021
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7

本文标签: AccountusermodLinuxExpiredadministrator