免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1952 | 回复: 0
打印 上一主题 下一主题

solaris 10 root忘记密码的解决方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-18 15:22 |只看该作者 |倒序浏览

solaris 10 root忘记密码的解决方法
我的root本来是没有密码的。在控制台用root登陆了,执行了sys-unconfig,重新配置了一下系统信息。密码依然留空。(sys-unconfig会清除所有的设置信息,包括root密码,奇怪的是却不会删除其它用户的密码。)再登陆时,突然要我输入密码。
上哪儿去偷呢?想哭~
查看soliaris的文档
817–1985–15 SystemAdministration Guide:Basic Administration 的Managing UserAccounts and Groups
(Overview)部分

,里面有说明:
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在其文档
817-1758 System Administration Guide: Advanced Administration
里提供的的解决办法。
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"将文件改为可读写)。还要问我要密码。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/52953/showart_1004631.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP