linux 用户密码到期导致ftp业务失败
外网反馈某业务失败,查看log发现FTP连接失败,定位发现提示密码不对,重新修改FTP密码后恢复正常。
但同时定位了下FTP密码被修改的原因,发现是密码过期了,因此查了下资料,查得修改过期时间的方法
1.vim /etc/login.defs
PASS_MAX_DAYS 99999
2.chage username -M 99999
下面是使用到的命令chage:
[root@APPServer yang]# chage --help
Usage: chage [options] [LOGIN]
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
以及一个不过期的账户信息:
[root@APPServer yang]# chage username -l
Last password change : May 17, 2018
Password expires : never
Password inactive : never
Account expires : never
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