Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1269020
  • 博文数量: 125
  • 博客积分: 4372
  • 博客等级: 上校
  • 技术积分: 1055
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-12 09:53
文章分类

全部博文(125)

文章存档

2019年(3)

2018年(2)

2017年(1)

2016年(2)

2015年(4)

2014年(11)

2013年(5)

2012年(4)

2011年(12)

2010年(10)

2009年(17)

2008年(17)

2007年(25)

2006年(12)

分类: 系统运维

2011-12-29 10:24:58

root:!:0:0::/:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:
guest:!:100:100::/home/guest:
nobody:!:4294967294:4294967294::/:
lpd:!:9:4294967294::/:
lp:*:11:11::/var/spool/lp:/bin/false
invscout:*:6:12::/var/adm/invscout:/usr/bin/ksh
snapp:*:200:13:snapp login user:/usr/sbin/snapp:/usr/sbin/snappd
ipsec:*:201:1::/etc/ipsec:/usr/bin/ksh
nuucp:*:7:5:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico
pconsole:*:8:0::/var/adm/pconsole:/usr/bin/ksh
esaadmin:*:10:0::/var/esa:/usr/bin/ksh
sshd:*:206:201::/var/empty:/usr/bin/ksh
atc:!:8000:400:Adam Cormany,Sr UNIX Admin:/home/atc:/bin/ksh
amdc:!:8001:401:AMDC:/home/amdc:/bin/ksh
pac:!:8002:400:PAC,Jr UNIX Admin:/home/pac:/bin/ksh
atc2:!:8003:402:ATCv2:/home/atc2:/bin/ksh

Username : Password Flag : UID : GID : GECOS : Home : Shell/Command


Here's the line-by-line breakdown:

  • Username. This is the login/user name associated with the account.
  • Password Flag. This field varies slightly in different flavors of UNIX and Linux. In AIX, the second field can contain one of two characters, either ! or *. If the ! is displayed, a password has been set for the user. If no password has been set, * appears. The passwords themselves are stored in /etc/security/passwd.
  • UID. The User Identifier (UID) is a numeric identifier to a user.
  • GID. The Group Identifier (GID) is similar to the UID but is associated with groups. The GIDs are defined in /etc/group.
  • GECOS. The General Electric Comprehensive Operating System (GECOS) information is stored in the fifth field. The user's name, phone numbers, and other generic personal information are stored here.
  • Home. This is the user's home directory.
  • Shell/Command. Typically, the seventh and final field contains the shell that is started at the user's login. Administrators can also change this field to execute other commands instead of shells to limit access (for example, /bin/false).

新建立用户之后执行命令:

#pwdadm username      */ 修改密码

#pwdadm -c username   */在/etc/security/passwd中, -f flags有3个选项,此命令可以去掉ADMCHG选项

NOCHECK
Signifies that new passwords need not follow the guidelines established in the /etc/security/user file for password composition.
ADMIN
Specifies that password information may be changed only by the root user. Only the root user can enable or disable this attribute.
ADMCHG

 Resets the ADMCHG attribute without changing the user's password. This forces the user to change passwords the next time a login command or an su command is given for the user. The attribute is cleared when the user specified by the User parameter resets the password.

#pwdadm -q username  */查询状态

如果没有ADMCHG,则登录后不需要修改密码.

也可以通过查看/etc/security/passwd查看用户信息.

修改GECOS字段的一些信息:

-f wzf
 wzf's current gecos:
                "wangfei"
 Change (yes) or (no)? > y
 To?>Tom
wzf /etc/passwd
wzf:!:206:1:Tom:/home/wzf:/usr/bin/ksh
wzf
 wzf's current gecos:
                "Tom"
 Change (yes) or (no)? > y
 To?>James

-l wzf
Login name: wzf                       In real life: James
Directory: /home/wzf                    Shell: /usr/bin/ksh
No Plan.

 

 

阅读(9986) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~