查看linux用户密码过期时间并提醒


1.查看linux用户密码过期时间命令

 

[root@Centos6 /]# chage -l euser

Last password change : Aug 28, 2015 【最近一次修改密码的时间】
Password expires : Nov 26, 2015 【密码过期时间】
Password inactive : never 【密码失效时间】
Account expires : Jan 31, 1970 【账户过期时间】
Minimum number of days between password change : 0 【两次改变密码之间相距最小天数】
Maximum number of days between password change : 90 【两次密码改变密码相距最大天数】
Number of days of warning before password expires : 15 【密码过期前开始警告的天数】

  

2.查看所有用户的过期时间

cat /etc/passwd |awk -F ":" '{print $1}' |while read line;do chage -l $line ;done
Last password change                                    : Dec 09, 2019
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
Last password change                                    : May 21, 2019
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
Last password change                                    : May 21, 2019
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

3.提醒 如发短信

curl -X POST -d "{something}" http://smsGateway.com
curl: (7) Failed to connect to smsGateway.com port 80: Connection refused

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM