# passwd oracle
New Password:
Re-enter new Password:
passwd: oracle does not exist.
Permission denied
# more /etc/passwd
root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
sybase:x:1200:120::/sybhome:/usr/bin/sh
oracle:x:100:120::/exprot/home/oracle10:/bin/bash
# userdel oracle
UX: userdel: ERROR: Inconsistent password files. See pwconv(1M).
# pwconv
pwconv:开启用户的shadow口令.
一般来用pwconv来同步口令,下面来说一下,它的工作流程:
pwconv依赖于passwd中的密码区'x'来同步/etc/passwd与/etc/shadow这两个文件;以/etc/passwd为主来控制/etc/shadow中的各项:
A:若/etc/shadow不存在,则pwconv将用/etc/passwd来建立
B:若/etc/shadow已存在,则:
1.若条目在passwd中已存在,而不在shadow中,则在shadow中添加相关条目
2.若条目在shadow中已存在,而不在passwd中,则从shadow中删除相关条目
# passwd oracle
New Password:
Re-enter new Password:
passwd: password successfully changed for oracle