ITPub博客

首页 > Linux操作系统 > Linux操作系统 > AIX和Redhat的passwd文件和shadow文件

AIX和Redhat的passwd文件和shadow文件

原创 Linux操作系统 作者:robinhxh 时间:2010-05-10 12:15:36 0 删除 编辑

passwd文件 能列出系统所有的用户及权限以及

AIX路径 /etc/passwd 权限是 -rw-r--r--

/etc/passwd 文件以冒号分隔,它包含以下信息:
•用户名 •已加密密码 •用户标识号(UID) •用户的组标识号(GID)
•用户全名(GECOS) •用户主目录 •登录 shell

例:root:!:0:0::/:/usr/bin/ksh

sshd:*:203:203::/var/empty:/usr/bin/ksh

其中!表示密码加密存储在/etc/security/passwd中,

* 表示lock用户,无法登陆

the account has been defined to the system but is not an account that can be logged into yet. There will not be an entry placed into the /etc/security/passwd file until a passwd has been assigned to this account.

Redhat路径/etc/passwd 权限是 -rw-r--r--

用户名/密码/UID/GID/使用者描述/家目录/shell执行目录

root:x:0:0:root:/root:/bin/bash

test:x:502:500::/home/test:/bin/bash

X表示密码存储在/etc/shadow中, uid基本上是1-99是系统预设帐号,100-499是服务帐号,500-以上是建立的用户, 家目录是该用户登录后直接到该目录下,可以修改

shadow文件 记录加密密码及最后一次密码更改时间 对于ID审计是重点考察文件

AIX路径 /etc/security/passwd 权限是 -rw------- root security

password = eacVScDKri4s6 (加密的密码)
lastupdate = 1026394230
flags = ADMCHG (表示下次登录要求更改密码)

在这个文件中如果password=* 表示该用户没有密码,无法登陆系统,只有当管理员给这个用户设置了密码后才能够登录系统

lastupdate

To force users to change their password, perform the following procedures.

  1. Edit /etc/security/login.cfg and change maxage=1. This will force users, who haven't changed their password in the past week, to do so the next time they login.
  2. If some people have changed their password in the past week, review the lastupdate field for that user. Subtract 604800 (number of seconds in one week) from the value specified in the lastupdate field . The next time that user logs into the system, they will be forced to change their password. The lastupdate field represents the number of seconds passed since Jan 1, 1970.

    A simpler way to force a user to change their password the next time they log into the system is to change that user's flag field to ADMCHG. Use the command pwdadm -f ADMCHG to change the flag.

    • The next time a login or su command is executed for that user, they will be forced to change their password, based on the password guidelines specified in the /etc/security/login.cfg file.
    • If the user has a password, they will be asked for their original password before being prompted to change to a new password.
    • Make sure the mindiff attribute in the pw_restrictions stanza of /etc/security/login.cfg is nonzero to force the new password to be different from the old one.

flag

If flag field for a user is set to llags = NOCHECK, then the /etc/security/login.cfg restrictions won't apply to that user for new passwords that follow

redhat文件 /etc/shadow

root:$1$uHVI0B$t/rEHObjn6ZLSklNYu2oj0:14711:0:99999:7:::

用户名

密码(如果在密码位前加上*或者!,表示禁止登录)

更改密码的一天(这个时间以1970年1月1日为1,累计)

密码不可更改的天数(几天可以改密码)

密码有效天数/密码更改警告天数

密码过期宽恕期

密码失效期

保留栏

注: 如果root密码失效或者忘记,可以用维护方式进入系统,更改这个文件,将root密码位置设置空,就可以用root空密码进入系统了.

以上相关技术资料有来源于网络,有来源于实际操作。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23884302/viewspace-1033500/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: ITPUB BLOG开通通告
请登录后发表评论 登录
全部评论

注册时间:2010-05-10

  • 博文量
    5
  • 访问量
    17712