重置Macos密码

Recovery Mode

In Lion and Mountain Lion you can use Recovery Mode to reset the password.  Just restart the computer and hold down Command + r until the menu screen appears.  Click Terminal from the Utilities Menu and enter this:

resetpassword

 

Single User Mode

The other option is to delete the Apple Setup file to trick the Mac into thinking it just came off the truck from the factory.

After deleting the Setup File and rebooting, you’ll see a “Welcome to Mac OS X” setup screen which will walk you through the process of creating a new admin account.

To make it happen, we have to boot into something known as Single User Mode.  This is a limited environment with no graphical user interface but is very helpful when you need to perform advanced troubleshooting.

That’s what we’re going to do today.

Reboot the Mac and hold down Command + s to enter Single User mode.  Keep holding down Command + s until you see a black screen with white text.

The command prompt is that right rectangle near the bottom of the screen.  This is what it looks like on my Macbook Air:

fixedbyvonnie-mac-os-x-single-user-mode.jpguploading.4e448015.gif转存失败重新上传取消Mac OS X Single User Mode

At the command prompt enter this:

mount -uw /

This mounts the root file system (the forward slash /) and tells the computer to change the status of any already mounted file systems (that’s the -u part of the command) and make sure it’s read-write (the w in the command).

Press enter to move to the next line and type this:

rm /var/db/.AppleSetupDone

This looks a little more cryptic than the mount command but it’s not too hard to decipher if you break it into groups.

The rm part removes directories.  In this case, it’s removing a directory that lives in a /var/db/ called .AppleSetupDone

Deleting this folder is the trick that forces the Mac to think it has a new lease on life.

Press enter to move to the next line and finish up with this command:

shutdown -h now

The dash h halts the Mac at a specified time, in this case we’re saying, “Shutdown Now

 

 

http://www.fixedbyvonnie.com/2013/09/how-to-reset-the-admin-password-on-your-mac-without-a-disk/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值