- 论坛徽章:
- 2
|
我遇到过几次,没有提示输入新密码,只是说root密码过期,还好console进去后都在#下就直接改了,不过,密码过期一般会涉及到下面2个文件:
# grep -v "^#" passwd
MAXWEEKS=
MINWEEKS=
PASSLENGTH=6
# more /etc/shadow
root:N4QSDJnL.DvHw:14541::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
smmsp:NP:6445::::::
listen:*LK*:::::::
gdm:*LK*:::::::
webservd:*LK*:::::::
postgres:NP:::::::
svctag:*LK*:6445::::::
nobody:*LK*:6445::::::
noaccess:*LK*:6445::::::
nobody4:*LK*:6445::::::
mailsrv:*LK*:::::::
Symptoms
If the number of days of inactivity set for a user are exceeded,
the following messages are displayed as the user attempts to login: invalid userid login incorrect The same message occurs when root attempts to modify the user with the /bin/passwd command. The user is also inaccessible
via Solstice Adminsuite[TM] or Solstice Admintools[TM]. To the system,the user does not exist.
Resolution
The following steps are necessary to reactivate the expired user:
1) If a user is suspected to have expired, locate the "expired" user in /etc/shadow. We'll call him "userx".
The entry may resemble this:
userx:gBtBLe7w3wkFo:10973::90:7:45::
Notice the 7th field is populated with '45', which means:
"This user expires if inactive for 45 days"
We'll assume 45 days have passed since userx user logged in, and the user is now expired.
2) Use usermod to remove the "inactive" (7th) field for the user:
# usermod -f 0 userx
Changes this: userx:gBtBLe7w3wkFo:10973::90:7:45::
To this: userx:gBtBLe7w3wkFo:10973::90:7:::
If "usermod" is unavailable or fails to remove the entry, just edit /etc/shadow manually removing the 7th field of the user.
3) Then, as root, reset the password for the user:
# passwd userx
New password:
Re-enter new password:
passwd (SYSTEM): passwd successfully changed for userx
4) Now login, rlogin or telnet in as userx (not su), enter the password,
then logout, the account is now reactivated.
To reset the "inactive" expiration period for userx, perform the following:As root, add the inactive field back for the user using either admintool or usermod.
Example of usermod command:
# usermod -f 45 userx
This will place the value of 45 back in the "inactive" (7th) field for the user:
userx:gBtBLe7w3wkFo:10975::90:7:45::
[ 本帖最后由 东方蜘蛛 于 2009-11-20 10:57 编辑 ] |
|