Chinaunix

标题: 一个面试的问题,请教一下。 [打印本页]

作者: xuzhendong    时间: 2016-03-04 09:23
标题: 一个面试的问题,请教一下。
昨天面试被问到一个问题,
linux或者bsd下,我想查询用户最后一次修改密码的时间,该如何操作。
想破头也没想出来?
作者: shijiang1130    时间: 2016-03-04 11:12
  1. -S, --status        Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days.
复制代码

作者: action08    时间: 2016-03-04 19:41
linux是什么情况呢
作者: lsstarboy    时间: 2016-03-05 08:41
BSD中有last,linux中有没有?应该也有吧。
作者: lsstarboy    时间: 2016-03-05 09:42
找了个centos,linux中也有last
作者: lsstarboy    时间: 2016-03-05 11:26
回复 2# shijiang1130

你这个是passwd的man吗?FreeBSD下的passwd没有这个参数。
   
作者: action08    时间: 2016-03-08 19:46
last本来就是unix的,linux也有
作者: 猴马大叶    时间: 2016-03-09 12:15
passwd -S  或 last 显示的信息不一样啊
last是显示最后的几条命令行操作信息
作者: wangxin4920    时间: 2016-03-11 16:03
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2