Macbook Pro 密码设置

本文介绍了一种在Mac上设置空密码失败后的修复方法,包括修改SUDOERS文件和使用恢复模式重置用户密码的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

需要将机器借给同事做测试,所以想吧密码设成空密码。在设置空密码过程中,没有细看系统提示(抽时间我会在去试一遍),直接回车修改完成。

杯具发生了,重新登录系统的时候,空密码不生效;更惨的是,旧的密码系统也不认了!


由于机器很新,没有系统备份,也没有系统盘。于是就有了以下的恢复过程。


1. 修改SUDOERS. 参考: http://www.macobserver.com/tip/2003/06/16.1.shtml

  1. Reboot the machine into single user mode (CMD+S on boot)
  2. Mount the root file system as read/write (mount -uw /)
  3. Edit the SUDOERS file (visudo)
  4. Change all occurences of "(ALL) ALL" to "NOPASSWD: ALL" (Note: You'll need to know your way around the text editor vi -- check out the vi tutorial in MacOS X Command Line 101 for more. -TMO)
  5. Save the SUDOERS file and reboot (ESC-w, ESC-q, 'reboot')
  6. Open a terminal and execute the command 'sudo passwd root' ----注意,这一步不工作,会有 “passwd the daemon encountered an error”错误提示。
2. 修改系统密码. 参考:  http://forums.macrumors.com/showthread.php?t=1191262

Step 1:Boot your mac with Option + R holding it will boot into recovery mode

Step 2: go into disk util and take terminal

Step 3: write resetpassword


好了。新的用户密码修改成功。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值