Chinaunix

标题: Aide-memoire: Darwin/x86 Lost Root Password - recovery [打印本页]

作者: En_route    时间: 2004-01-09 10:39
标题: Aide-memoire: Darwin/x86 Lost Root Password - recovery
Step 1: At boot2 prompt: hd()mach_kernel -s

After booting, the kernel will spawn a shell with the familiar "sh#" shell prompt.

Step 2: Execute a fsck command to ensure integrity of filesystem:

sh# /sbin/fsck -y

Wait for the system to salvage any loose bits and pieces. The system will finish off with another "sh#" shell prompt.

Step 3: Mount the filesystem read/write -- otherwise you cannot change anything, including the lost password

sh# /sbin/mount -uw /

Step 4:

sh# passwd root  /* set your new password with the passwd command, ** Note ** default is Netinfo */

or

sh# passwd -i file root /* set your new password with the '-i file' attributes for flat files and pwd_mkdb -p the master passwd file as usual */

Step 5:

sh# reboot


AND you can login as root with the new password.

HAVE    FUN!
作者: Aki    时间: 2004-01-10 12:11
标题: Aide-memoire: Darwin/x86 Lost Root Password - recovery
Great.
作者: sniper    时间: 2004-03-16 22:07
标题: Aide-memoire: Darwin/x86 Lost Root Password - recovery
Oh,I got it.Thanks.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2