有没有列出所有用户创建时间的方法
发表于 : 2012-08-12 19:43
初三学生毕业了,机子上创建的账号要删除,怎样快速查出来哪些用户是初三的号并彻底删除
新的初一学生也要新建账户,用什么方法可以避免下次删除的时候不好找
新的初一学生也要新建账户,用什么方法可以避免下次删除的时候不好找
代码: 全选
awk -F ':' '{ if ($1 ~ /^2010/ ) {print $1; system("deluser "$1)}}' /etc/passwd
● t=15511; date --date="@`echo $(($t*24*60*60))`"date of last password change
The date of the last password change, expressed as the number of
days since Jan 1, 1970.
The value 0 has a special meaning, which is that the user should
change her pasword the next time she will log in the system.
An empty field means that password aging features are disabled.
存下多谢babysoul 写了:找到所有以2010(假设是初三学生帐号)开头的帐号名,并删除用户代码: 全选
awk -F ':' '{ if ($1 ~ /^2010/ ) {print $1; system("deluser "$1)}}' /etc/passwd
这个似乎可行,改密码的不会太多,当时让用自己名字注册,相互印证应该可以找出,就是有些费脑筋eexpress 写了:额。目录是看不出。
/etc/shadow里面的时间,才可以参考。修改密码的天数?
● t=15511; date --date="@`echo $(($t*24*60*60))`"date of last password change
The date of the last password change, expressed as the number of
days since Jan 1, 1970.
The value 0 has a special meaning, which is that the user should
change her pasword the next time she will log in the system.
An empty field means that password aging features are disabled.
2012年 06月 20日 星期三 08:00:00 CST