how to reset mac root password

Reset 10.5 Leopard & 10.6 Snow Leopard password

  1. Power on or restart your Mac.
  2. At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
  3. This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
  4. Type mount -uw / and press Enter.
  5. Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist and press Enter.
  6. Type ls /Users and press Enter. This lists all of the usernames on the computer – helpful if you don’t know or remember what these are.
  7. Type dscl . -passwd /Users/username password and replace “username” with one of the users displayed in the previous step. Replace “password” with a new password of your choice. Press Enter.
  8. Type reboot and press Enter.

Reset 10.4 Tiger password

  1. Power on or restart your Mac.
  2. At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
  3. Type sh /etc/rc and press Enter/Return.
  4. Type passwd username and replace “username” with the short name of the user account for which you’d like to reset the password.
  5. Type your desired password and press Enter. It won’t show itself on the screen, so be careful what you type. You will most likely have to enter it again to confirm.
  6. Type reboot and press Enter.

Tricking your Mac into creating a new user account

  1. Power on or restart your Mac (should work for any Mac OS X system).
  2. At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
  3. This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
  4. Type mount -uw / and press Enter.
  5. Type rm /var/db/.AppleSetupDone and press Enter.
  6. Type shutdown -h now and press Enter.

The third method of resetting your Mac’s password requires some additional explanation. Rather than simply changing the password like the previous two methods do, this one fools the operating system into believing it has never been started before. This means when you restart the machine, it will take you through the entire setup & registration process all over again. Do not worry, all of your pre-existing data is still available. Just continue with this process and do not choose the option to transfer or migrate information to the Mac.

Once you’re done, log in with your new admin account and go to System Preferences > Accounts. You may have to click on the lock icon in the lower-left corner before making changes here. You should see your original user account(s) in the left column. Try clicking on one of them to convert it to a standard user account (uncheck “Allow user to administer this computer”) and change the password. You should be able to successfully log in to that account now and access all of your files and programs. If you want, you can log back in with your new admin account and re-check the “Allow user to administer this computer” option in System Preferences to grant admin privileges to the original user again.

That should cover it! As always, remember messing with single-user mode and Terminal is risky and may lead to trouble if you make mistakes. Considering you’re already locked out of the computer, though, you’ll probably be willing to take your chances at this point.

One last thing… if you have a Keychain Access password, you will probably need to reset that as well. You can do this by selecting “login” under Keychains on the left and choosing Delete from the Edit menu. You’ll lose everything in the Keychain, but you’ll now be able to start fresh and add new ones.

Reset password using Lion Recovery

If you bought a brand new Mac with Lion pre-installed, the hard drive includes with a recovery partition that gives you access to a bunch of different tools. Here’s how to take advantage of this utility to reset your Mac’s password:

  1. Shut down your Mac and turn it back on while holding down the Command and R keys at the same time until you see the Lion Recovery screen.
  2. From the menu bar at the top, select Utilities > Terminal.
  3. In the Terminal window type resetpassword and press Enter.
  4. Use the Reset Password utility to select your hard drive, choose your user account, and enter a new password.

Reset Lion password with Single User mode

Anyone running Mac OS X Lion can take advantage of this method:

  1. Shut down your Mac and turn it back on while holding down the Command and S keys at the same time until your see a black screen with white text. This is known as Single User mode.
  2. You can skip this step, but it’s recommended that you don’t because it will check the consistency of your hard drive. At the prompt, type fsck -fy and press Enter.
  3. Once the disk check is complete and the prompt returns, type mount -uw / and press Enter.
  4. Type launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist and press Enter.
  5. Type ls /Users and press Enter. All of the usernames on the computer will be listed, which is helpful if you don’t know or remember what these are.
  6. Type dscl . passwd /Users/username password while replacing username with one of the users displayed in the previous step and replacing password with the new password of your choice. Press Enter. You will likely get an error message about a file or directory not being found – it’s safe to ignore this.
  7. Type reboot and press Enter.
时间: 2024-10-04 08:17:58

how to reset mac root password的相关文章

CentOS 7 / RHEL 7 : Reset / Recover forgotten root password

CentOS 7 / RHEL 7 : Reset / Recover forgotten root password October 11, 2014 by sharad chhetri 4 Comments In this post we will learn, how to reset / recover forgotten root password on CentOS 7 / RHEL 7 (Red Hat Enterprise Linux 7). On RHEL 5/6 or Cen

Reset root password in CentOS 7 / RHEL 7

There may be some occasion you will end up with requirement to reset the root password, the occasion comes when you forget root password; follow this guide to reset the password of root. In CentOS, single user mode will help us to achieve our goal of

How To Reset Your Forgotten Root Password On CentOS 7 Servers

Sometimes you forget stuff. I do. I forget important passwords for important websites sometimes. Retrieving your forgotten passwords for most websites is easy, all one has to do remember few details that were used when signing up for the service to g

RHEL7 recover reset root password

If you have lost or forgot root password of RHEL7, you can follow this step to change to a new password, this is different with the RHEL6  single-usermode, 1, press e button in GRUB 2 boot screen. 2, at the end of Linux line add init=/bin/sh and remo

mysql forget root password

http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - Resetting a lost MySQL root password The MySQL root password allows full access to the MySQL database and allows for all actions to be undertaken inc

MYSQL更改root password时遇到Access Denied的解决办法

今天在公司虚拟机上装MYSQL之后需要修改root password,然而遇到这样的错误: Access denied for user 'root'@'localhost' (using password:YES) 后来在网上搜了下,找到如下解决办法,测试可用. # /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &# mysql -u root mysqlmysql&g

linux开机出现一下错误Give root password for maintenance (or type Control-D to continue):

linux开机出现一下错误Give root password for maintenance (or type Control-D to continue): 第一种错误的情况: 由于错误的编辑/etc/fstab文件 而引起的不能正常进入系统.假如你将某一个分区或者磁盘最后一个参数设置为1或2时,系统默认会在开机过程中检查这个磁盘的扇区.假如系统检查不到这个磁盘,或者这个磁盘根本检测不到(尤其是在网络存储时)那么系统就会报错,导致出现这种情况. 解决办法:输入root密码,此时整个文件系统是

MYSQL安装时解决要输入current root password的解决方法

在装MYSQL的时候发现要输入current root password不记得以前在电脑里装过(你的系统曾经装过MYSQL在重装就会要求输入原来设定的密码,如果是第一次安装就不会出现),在网上苦苦搜寻解决方法. 终归结出以下解决方法: 1.清除MYSQL的安装目录,默认是C:\Program Files 2.清除MYSQL数据存放目录,一般在C:\Documents and Settings\All Users.windows\Application Data目录下 (需要注意的时Applica

重启CentOS7时进入如下界面提示“give root password for maintenance”

问题描述: 重启CentOS7时进入如下界面提示"give root password for maintenance",进入如下界面 问题原因: ]# vim /etc/fstab 发现里最后三行是我做实验自己加上去的,我把这3个挂载设备删除了,但这里的自动挂载忘删了. 问题解决: 把自己添加上去的那三行删掉,reboot即可.