免费注册 查看新帖 |

Chinaunix

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

求助!/etc/passwd文件丢失或损坏,如何解决 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-12-05 21:19 |只看该作者 |倒序浏览
求助,/etc/passwd文件丢失或损坏,如何解决

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
2 [报告]
发表于 2006-12-05 21:36 |只看该作者
为什么会丢失或损坏,除非人为瞎搞
这些重要的系统文件建议修改之前一定要做好backup!

论坛徽章:
0
3 [报告]
发表于 2006-12-05 21:45 |只看该作者
惨,二楼的大仙不知道偶更不知道

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
4 [报告]
发表于 2006-12-05 22:01 |只看该作者
没有做备份那也没有办法了,如果除了系统用户没有什么其他用户就手动建立一个了,可以参考其他主机上的passwd文件!

论坛徽章:
0
5 [报告]
发表于 2006-12-06 10:11 |只看该作者
遗忘ROOT口令
--------------------------------------------------------------------------------

作者:南非蜘蛛???zhedou@163.com

方法一:

1.别怕 ,跟我来.
2.把你的solaris光盘放进cdrom
3.键入stop+a
4.当出现'ok'字样时,键入boot cdrom -s
5.cd /tmp
6.mkdir /tmp/xxx (xxx是什么鬼东西就无关紧要了)
7.mount /dev/dsk/c0t0d0s0 /tmp/xxx (在这里c0t0d0s0是你的root盘)
8.运行csh
9.TERM=sun;export TERM或者
setenv TERM vt220
10.cp /tmp/root/xxx/shadow /tmp/root/xxx/shadow/shadow.backup
11.vi /tmp/root/xxx/shadow并且将password里root项删除。
12.重启动,你就可以以无密码的root登陆了,这时更改你的密码。


要是没有shadow,就把/etc/passwd里root用户名后面的X删掉,就可以了

方法二:

找一台有系统的solaris机器,把忘记密码的系统放进去mount上来,重复方法一10以后的步骤.


道理一样,更改root的/etc/password的shell。。

论坛徽章:
0
6 [报告]
发表于 2006-12-06 16:36 |只看该作者

恢复了passwd和shadow,依然无法进入系统

我参考了其他主机的passwd和shadow,将故障机完全恢复到和正常机器一样,但是在启动的时候仍然报如下错误:
syslog service starting.
! No such user as adm - cron entries not created 三 12月  6 13:58:42 2006
! No such user as root - cron entries not created 三 12月  6 13:58:42 2006
! No such user as sys - cron entries not created 三 12月  6 13:58:42 2006
! No such user as lp - cron entries not created 三 12月  6 13:58:42 2006
! No such user as uucp - cron entries not created 三 12月  6 13:58:42 2006



The system is ready.
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>
missing or bad passwd entry for <root>

还会是什么原因呢?

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
7 [报告]
发表于 2006-12-06 17:41 |只看该作者
原帖由 youngplayer 于 2006-12-6 16:36 发表
我参考了其他主机的passwd和shadow,将故障机完全恢复到和正常机器一样,但是...


主要要恢复用户名称、UID、GID等,shadow里的加密口令不能简单复制,还是清空之后重新设置才行。

论坛徽章:
0
8 [报告]
发表于 2006-12-07 06:16 |只看该作者
The system should have automatically saved your orginal passwd file as /etc/opasswd. To recover your /etc/passwd file:

1. Boot from cd to single user mode: OK> boot cdrom -s
2. mount your root partition under /a such as mount /dev/dsk/c0t1d0s0 /a
3. cd /a/etc
4. cp -p opasswd  passwd
5. If you also need to restore shadow file, make a copy of the shadow file if exist, then cp -p oshadow shadow (depending on Solaris version, you may no may not have oshadow file)
6. Reboot your machine and login as root
7. If the user information in /etc/passwd file is more up-to-date then that is in /etc/shadow file, type command pwconv to sync the two files (caution: the command will erase the user entry from /etc/passwd file if it appears in /etc/shadow file but not in /etc/passwd file)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP