我的root本来是没有密码的。在控制台用root登陆了,执行了sys-unconfig,重新配置了一下系统信息。密码依然留空。(sys-unconfig会清除所有的设置信息,包括root密码,奇怪的是却不会删除其它用户的密码。)再登陆时,突然要我输入密码。
上哪儿去偷呢?想哭~
查看soliaris的文档,里面有说明:
Password information is stored as follows:
· In the passwd file when you are using NIS or NIS+
· In the /etc/shadow file when you are using /etc files
· In the people container when you are using LDAP
The fields in the shadow file are separated by colons and contain the following information:
username:password:lastchg:min:max:warn:inactive:expire
password Might contain the one of following entries:
· A13-character encrypted user password
· The string *LK*, which indicates an inaccessible account
· The string NP, which indicates no password for the account
也就是说,空密码的root,在/etc/shadow中应该有如下信息:
root:NP:6445::::::
我看了我的shadow文件
#vi /etc/shadow
root::6445::::::
按照solaris10在其文档里提供的的解决办法。
What to Do if You Forgot Root Password
If you forget the root password and you cannot log into the system, you will have to:
* Stop the system by using the keyboard stop sequence.
* Boot from a boot or install server or from a local CD-ROM.
* Mount the root (/) file system.
* Remove the root password from the /etc/shadow file.
* Reboot the system.
* Log in and set root's password.
还描述得甚为详细:
# vi shadow
(Remove root's encrypted password string)
这里为空就没有密码了,然而登陆不上却是事实。改成root:NP:6445::::::(先用命令"chmod +rw shadow"将文件改为可读写)。还要问我要密码。