Chinaunix首页 | 论坛 | 博客
  • 博客访问: 817521
  • 博文数量: 581
  • 博客积分: 7803
  • 博客等级: 少将
  • 技术积分: 3653
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-27 08:21
文章分类

全部博文(581)

文章存档

2013年(7)

2012年(414)

2011年(159)

2009年(1)

分类: LINUX

2011-07-14 10:51:54

目前,linux默认将用户密码存储在/etc/shadow文件中
passwd文件默认权限是644,shadow文件默认权限是400
shadow文件支持密码过期设定等功能
shadow文件中每一行表示一个系统用户的密码记录,用:号分隔
用户可以通过authconfig来设定是否使用shadow文件及md5加密

shadow文件详细
shadow文件中每一行的每一项具体说明:
-登录用户名
-用户密码(一般经md5加密)
-从1970年1月1日起到密码上一次被更改的时间
-密码再过几天可以被变更(0表示随时可以被变更)
-密码再过几天必须被变更(99999表示永不过期)
-密码过期前几天系统提醒用户(默认为一周)
-密码过期几天后账号会被取消
-从1970年1月1日算起,多少天后账号失效

如果发现某个用户的密码是*或者!开头,说明此用户已经被锁定,不能登录我们的linux系统
如果文件为只读文件,用vi编辑文件的时候,按wq!强行保存退出。

passwd文件:
1.Username
2.Salt combined with the current hash of the user's password (usually produced      from a cryptographic hash function)
3.User ID (UID)
4.Default group ID (GID)
5.Full name
6.Home directory path
7.Login shell

shadow文件:
User login name
salt and hashed password OR a status exception value e.g.:
"$id$salt$encrypted", where "$id" is the hashing algorithm used (On linux, "$1$" stands for MD5, "$2$" is Blowfish, "$5$" is SHA-256 and "$6$" is SHA-512, crypt(3) manpage, other Unix may have different values, like NetBSD).
"NP" or "!" or null - No password, the account has no password.
"LK" or "*" - the account is Locked, user will be unable to log-in
"!!" - the password has expired
Days since epoch of last password change
Days until change allowed
Days before change required
Days warning for expiration
Days before account inactive
Days since Epoch when account expires
Reserved
阅读(2364) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~