大网数据广告活动
服务器运维问答

Why does password expire, if none is set?

· 52CE 我爱测

Why does the password expire? I am logging in with public key (without password) since several days. Today I get this message: > ssh modlink_foo_q@server You are required to change your password immediately (password expired) Las…

问题原文

原帖链接 · guettli · CC BY-SA 4.0

Why does the password expire?

I am logging in with public key (without password) since several days. Today I get this message:

> ssh modlink_foo_q@server

You are required to change your password immediately (password expired)
Last login: Wed Nov 14 09:26:48 2018 from 10.130.4.3
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for modlink_foo_q.

This is the matching line in /etc/shadow

server:~ # grep modli /etc/shadow
modlink_foo_q:!:17757:1:90:7:::

I think no password is set. Then who can it expire?

OS: SUSE Linux Enterprise Server 12 SP3

已采纳解答

原帖链接 · HBruijn · CC BY-SA 4.0

The value of your encrypted password (or the lack thereof) does not change the fact that a password expiry policy has been set.

See https://linux.die.net/man/3/shadow and https://linux.die.net/man/5/shadow

The current password was set on Tue Aug 14 2018
(the third field is sp_lstchg - the number of days since Jan 1, 1970 when the password was last changed: date --date '1970-01-01 +17757days')
(most likely when the account was created) and was valid for 90 days.
(field #5 sp_max - the number days after which password must be changed) I.e. the password was valid until date --date '1970-01-01 +17757days +90days' Mon Nov 12 2018.

You are currently in the 7 day grace period after the password expiry date and unless you either change the password, or change/update the policy fields (with chage) that account will considered inactive and disabled by Mon Nov 19 2018.

 chage --lastday 2018-11-14 modlink_foo_q 

will update the sp_lstchg field with today's date which will allow you to continue to use the account for another 90 before simulating a new password reset.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-11-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。