Videos
How can I retrieve my Mac password using Terminal?
Open Terminal on your Mac.
Type "sudo -s" and enter your current user password.
Enter "cat /var/log/secure."
Look for lines that start with "Password:". The characters following "Password:" represent your admin password.
Is there a keyboard shortcut to reset a password on a Mac laptop?
What should I do if I forget my Mac password?
After incorrectly entering your password up to three times, select the option to reset using your recovery key.
Enter your FileVault recovery key.
Input your new password details, then click "Reset Password."
You can reset the password in Mojave by entering recovery mode and using the "resetpassword" utility via the terminal:
- Boot your Mac while holding CommandR. When you get the Apple logo release the keys and allow the Mac to come up in Recovery Mode.
- When you get to the macOS Utilities dialog select Terminal from the Utilities menu
- Type resetpassword into the terminal window. In a few seconds the reset password utility will open and allow you to reset the password on your account.
It did change with the Supplemental Update you have to pass the old password, command run as root, with ot=the old password and t=the new password, for the account
dscl . -passwd /Users/account `echo "${ot} ${t}"`
We generate the to and t variables in a script.
Once you mount the file system, you should be able to use passwd username and then put in the password twice.
Try loading com.apple.opendirectoryd.plist instead.
- Hold command-S on startup.
- Run
mount -uw /. (fsck -fyis not necessary.) In 10.7 and later, run:
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plistor in 10.6 and earlier:
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist- Run
passwd usernameand reset the password. - Run
reboot.
A second way to reset the login password of an account is to use Reset Password.app from the recovery partition:
- Hold command-R on startup.
- Open Terminal from the Utilities menu.
- Run
resetpassword, which opens the Reset Password application. - Select the volume and account and reset the password.
A third way is to create a new admin account:
- Hold command-S on startup.
- Run
mount -uw /. - Run
rm /var/db/.AppleSetupDone. - Run
reboot. - Go through the steps of creating a new account.
- Reset the password of the old account from the Users & Groups preference pane.
None of these options resets the password of the login keychain.
If FileVault 2 is enabled, you have to enter a password to start up in single user mode, and you can't use Reset Password.app to reset the password of an account.
The drive is locked using FileVault encryption and cannot be accessed until you unlock the drive. This may be set to a master password of yours, and often is set a while back. You may want to try older passwords (or versions of them) to see if any of those work.
To unlock the drive:
- Boot into the recovery mode
- Launch Disk Utility
- Select the drive in disk utility
- Click unlock near the top of the disk utility window
Unfortunately, the drive will not allow you to boot into those options and/or work on it until you pass the encryption lock. It will require a password or for you to completely erase the drive.
For my problem, I tried the 'Boot into Recovery Partition' method and unlocked the volume because it was locked with FileVault password and fortunately I had saved the Filevault password. Here is the article with the steps I followed: https://iguruservices.com/support/reset-mac-admin-password/
It opened the disk utility first and unlock the disk and then opened terminal and type command resetpassword to change my admin password.
This answer assumes you have the login and password for an admin account within Ventura (possibly earlier version but I have not tested these).
Login on the Mac as an admin user. Let us assume this user is called admin
Now open Terminal.
At the command line, type:
dsenableroot -dYou will see:
username = adminuser password:Type the password for the admin user. You will see:
dsenableroot:: ***Successfully disabled root user.Type
dsenablerootYou will see:
username = adminuser password:Type in the admin user password again. You will see:
root password:Type in your new root password (twice)
You will see:
dsenableroot:: ***Successfully enabled root user.
Finally, don't forget your new password.
If you have an administrator user account set up on your Mac in addition to the root account, you can use the Directory Utility to do the following:
Open the Directory Utility from
/System/Library/CoreServicesor in OS X 10.11 and later,System/Library/CoreServices/Applications.Click the lock button and authenticate as an administrator:
Go to the menu Edit > Change root password...:
It should prompt you to enter a new root password:
Again, you have to have access to an administrator account to do this (so you can authenticate).
Good luck.
There are at least three ways to reset the login password of an account.
Using Reset Password.app on the recovery partition:
- Hold command-R on startup.
- Select Utilities > Terminal.
- Run
resetpassword, which opens the Reset Password application. - Select the volume and account and reset the password.
Using dscl in single user mode:
- Hold command-S on startup.
- Run
mount -uw /. - Run
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plistin 10.7 or later orlaunchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plistin 10.6 or earlier. - Run
dscl . passwd /Users/username passwordwhereusernameis the name of the account andpasswordis the new password. - Run
reboot.
Creating a new admin account:
- Hold command-S on startup.
- Run
mount -uw /. - Run
rm /var/db/.AppleSetupDone. - Run
reboot. - Go through the steps of creating a new account.
- Reset the password of the old account from the Users & Groups preference pane.
If FileVault 2 is enabled, you need to enter a password to start up in single user mode, and the list of accounts in Reset Password.app will be empty, so none of these methods can be used.
None of the methods above resets the password of the login keychain. If automatic login is enabled, you can print the password of the login keychain by running a command like this in single user mode before resetting the login password:
sudo ruby -e 'key=[125,137,82,35,210,188,221,234,163,185,31];IO.read("/etc/kcpassword").bytes.each_with_index{|b,i|break if key.include?(b);print [b^key[i%key.size]].pack("U*")}'
To reset password, You can force reseting admin password even if you forgot the password. This is not impacted to the installed application.
Steps:
- Boot Mac by pressing "command + R" until apple logo comes up which is "OSX Recovery" mode
- Go Utility Menu>Run Terminal
- Type "resetpassword" command
- Choose HDD and admin account which is initially created.
I'm quite new user for Mac so I'm not sure when it's implemented like this way but I heard old OSX has a menu in the recovery system(command + R) not like this way as I mentioned.
To install OSX, You can ask genius bar@apple store to install or you can install it via internet(Wired Lan) by pressing command+R option which is calls OSX recovery mode.
To backup the local disk, It's possible to backup local disk using the function called "Time Machine" on external drive and possible to restore.
FYI http://support.apple.com/kb/HT4718?viewlocale=en_US