mac系統忘記root密碼的解決辦法

來源:互聯網
上載者:User

由於長久不用Air了,所以忘記了之前的root密碼,導致很多命令都無法執行,於是找到了這個解決方案(經本人在Mac os x 10.6.8下測試成功!),故來跟大家分享下。

開機,並迅速按住 Command + S按鍵組合,進入命令列模式
輸入命令(有時可能要命令路徑不同,可參考螢幕上顯示的那兩行提示),檢查系統錯誤並修複
[plain] view plaincopy
/sbin/fsck -fy

輸入命令,使有許可權更改系統配置
[html] view plaincopy
/sbin/mount -uw /
最後根據命令
[html] view plaincopy
passwd root
來更改密碼就ok啦!
然後 敲入 reboot 命令,重啟機器就完工啦!

以下是原文:
Change an Admin Password in Mac OS X Single User Mode
This is a multistep process but it’s easy to follow:

First you need to enter Single User Mode. Reboot the Mac and hold down Command+S at boot to enter into the command line.
You’ll see a note where Mac OS X tells you that you need to run two commands in order to make filesystem changes, this is necessary so let’s handle that first
The first command checks the Mac OS X filesystem for errors and fixes them, it can take a few minutes to run:
fsck -fy

The next command mounts the root Mac OS X drive as writable, allowing you to make changes to the filesystem:
mount -uw /

After the filesystem is mounted, you can reset any users password using the following command:
passwd username

You’ll need to enter the new password twice to reset and confirm the changes

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.