Chinaunix首页 | 论坛 | 博客
  • 博客访问: 149139
  • 博文数量: 52
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 490
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-05 12:05
文章分类

全部博文(52)

文章存档

2013年(1)

2010年(3)

2009年(6)

2008年(25)

2007年(17)

我的朋友

分类:

2008-06-18 15:22:10

我的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"将文件改为可读写)。还要问我要密码。
阅读(1877) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~