Aide-memoire: Darwin/x86 Lost Root Password
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Oh,I got it.Thanks.
Great.