I forgot my administrator password on my MacBook, what should I do? How blocking works on a Mac, and what to do if your Mac is blocked. Reset your account password using your Apple ID

All Macs are initially configured in such a way that there is at least one administrator user in the OS. But it happens that when there are global changes to the system (installing updates, changing access rights) or computer configuration, the user with Mac OS “disappears” administrative privileges. That is, the account, for the most part, remains in the system (without any changes in the file hierarchy), but it is deprived of the ability to administer. This problem is not at all common, but in our practice it happens with enviable regularity.

We will consider two options possible restoration user with administrative privileges. The first is used by the author of the English-language article, Topher Kessler, the second is used by us. Until now. The third part of this article will be a list of tips on what to do if enabling the administration feature does not help. So,

Method one. Usage Single-user mode(Single User Mode) and System Setup Assistant

Initially, the new Mac ships without created user. When you turn on your computer for the first time, it automatically starts System Setup Assistant, working with superuser (root) access rights. This program offers create administrator and configure the system. After its completion, Mac OS marks the successful setup of the system and launches it again System Setup Assistant(present in Mac OS always and stored in the root folder System -> Libraries -> CoreServices) becomes impossible. The trick to the method proposed by Kessler is that you need to remove this mark and again run the setup program, create a new administrator and use it to change the access rights of previously created users.

The hidden mark indicating successful system setup is stored at /var/db and is named “.AppleSetupDone”. At everyone When the computer starts, the operating system checks for its presence and if it does not find this file, it launches the setup assistant automatically. Let's get started.

  1. We start the computer in Single-user mode(Single User Mode)
    To do this, restart the computer and, when turning it on, press and hold down two keys: ⌘(Command) + S. The usual graphical shell there won't be loaded, don't be alarmed, you'll be taken to the interface command line with superuser (root) access rights. This is a very powerful mode that gives complete unrestricted access to all aspects of the system using terminal commands; it must be used with understanding and a certain amount of caution. With the right skill, many of your Mac's problems can be resolved with its help.
  2. Enable write access in the file system
    By default when loading into Single-user mode you get read-only access to information from hard drive, without the possibility of changing it. This doesn’t suit us, so we enter the command:
    mount -uw /
  3. Removing the hidden mark about successfully completed system setup
    We enter a single command line to delete the file we need, exactly as it is presented below. Be careful, the only space present in the code is after the “rm” command, there should be no others.
    rm /var/db/.AppleSetupDone
  4. Reboot the computer
    All necessary actions required by us to be carried out in Single-user mode produced. Reboot the computer by entering the command:
    reboot

All commands have already been entered

The result of all operations performed will be the launch System Setup Assistant when you turn on the computer. Following his prompts, we create a new administrator, different from existing users (that is, the name of the user being created must be unique and different from the names of users already present in the system). We load into it and work in it.


This administrator user is temporary and will be deleted in the future; we only need it to enable administration for other accounts.

Now opening  -> System Preferences -> everyone accounts present on your Mac. All you need to do is find the required user and in its properties check the “Allow this user to administer the computer” checkbox. Which is exactly what we needed from the start!


The required checkbox is highlighted in red

Method two. Enabling the super-user root and working in it

This method is “more transparent” for fans of the graphical interface, so many will be more comfortable using it. The logic of the argument is similar to that presented above: to enable the administrator on a Mac (provided there is no at least one administrative account), you need to work with super-user rights, root. But this time we won't run System Setup Assistant, but elementary let's turn it on this account.

The super user root is always present on a Mac, but initially the ability to log into this account is limited. To enable it use Password reset utility.

    1. Start the computer from the recovery partition
      To do this, restart the computer and, when turning it on, press and hold down two keys: ⌘ (Command) + R. After the recovery system has loaded, a desktop with a menu bar will appear operating system and the program window Mac OS X Utilities.

    1. Let's launch Password reset utility
      From the menu bar, select Utilities -> Terminal. In the window that opens terminal enter the command exactly as shown below:




Exactly as in the instructions, enter the command “resetpassword”

    1. Enable super user root
      In the opened Password reset utility select the root user and set a password for the account. This must be done; the root user cannot be without a password. At Apple, when creating images of diagnostic systems, the default root password is configured, which is equivalent to its short name - “root”. Click the “Save” button, a message indicating the success of the procedure will appear.

By the way, using the recovery partition and Password reset utilities You can reset the password not only for the root user, but also for any other user represented in the system. If security is a big concern for you, Apple recommends turning on FileVault 2 data encryption, which makes this operation impossible.

Close all windows, including the window Mac OS X utilities. In the dialog box we will be asked to “Restart the computer”, to which we helpfully agree. When the system starts, the account login window will display new entry, "Another". This is what you need. Select it, enter “root” in the username, “root” in the password field (if in the third step of these instructions you entered your own password, enter it). Now by opening  -> System Preferences -> Users and Groups, you can manage everyone accounts present on your Mac. All you need to do is find the required user and in its properties check the “Allow this user to administer the computer” checkbox.

But that's not all. We solved the original problem, but at the same time made the operating system less secure by enabling the root super-user. It should be turned off.

  1. Disable root superuser
    While in the same “Users and Groups” settings System Settings Click on the “Login Options” tab and on the right side of the window we find the “Connect” button opposite the “Network Account Server” entry. Click it and then, in the window that opens, click the “Open Directory Service” button. A separate program is launched Directory service, in the menu bar of which select Edit -> Disable root user.

Part three. When enabling administrator is not enough

Yes, that happens sometimes too. You check the “Allow this user to administer this computer” checkbox. System settings , but this does not lead to the desired effect. In this case, there is only one way out - deleting the user.

Very important. Make sure you have backup everyone the data you need (if you make a small mistake in further steps, you can part with all the information)!

    1. We delete the user while saving all data and settings
      Open  -> System settings -> Users and groups, select the “unwanted” user and delete him by clicking on the minus “-” button. The system will ask you what to do with the user's home folder. Important! Select “Do not change user folder”.



    1. Checking the safety of the user folder
      Open the "Users" folder on your Mac and make sure that it contains the folder of the user you deleted one step earlier (the "Users" folder is stored in the root of the hard drive, for quick access to it in the menu bar Finder select Go -> Computer and open your hard drive, named "Macintosh HD" by default). Remember the name of this folder, it is equivalent to the name of the “account” (in the English interface the more understandable term “short name” is used) remote user. IN latest versions The operating system adds the “Remote” label to the name of the remote user. The folder name can be edited and this label can be erased.


The same mark

    1. Creating a new user
      In the same “Users and Groups” settings of the program System Settings Create a new user by clicking on the plus “+” button. It is very important at the creation stage to indicate the same “account” name (short name) that the user had previously, we remembered it in the paragraph earlier, it is the same as the folder of the remote user. And of course, change the type of new account you are creating from “Standard” to “Administrator”. If everything is done correctly, the operating system will report that it has detected another user folder and will offer to use it for the new administrator. Agree, this is what we started this whole thing about. A new account with administrative privileges will be created, saving all your data and settings.

If you work in an office or other place where unauthorized people can access your computer, it is useful to remember to lock your computer. This is a simple but reliable way to protect your data from falling into the wrong hands. When leaving the computer, many people often turn it off or put it to sleep instead of simply locking it. In the long term, such treatment can harm hard drives and SSDs, for which every full sleep is a load. We'll tell you how to quickly lock your computer. macOS control without putting him to sleep.

Hotkeys


Most quick way lock screen – quick keyboard shortcut. But in order not just to turn off the display, but to completely lock the computer, you must first change the standard system settings.

To do this you need:

    Open System Preferences > Security & Safety > General.

    Check the box next to “Request a password.” In the drop-down menu, select “immediately” or another interval of your choice.

    Lock screen with keyboard shortcut Ctrl + Shift + Eject or Ctrl + Shift + Power.

This key combination locks the computer screen, but does not send it to sleep. This means that all background tasks continue to run. If you need to put your computer into sleep mode, you need to use the keyboard shortcut to do this Command + Option+Eject or Command + Option + Power. If you have a new MacBook Pro With Touch Bar



One of the features new MacBook Pro with touch touch panel Bar – it does not have a “Power” button, so the classic key combination for locking the display cannot be used. The Touch Bar will come to the rescue, for which there is a special lock button. You can find it here:

System Preferences > Keyboard > Touch Bar Settings

Display settings



The macOS interface allows you to adjust the display's angles for quick actions. One of these actions may be putting the monitor into sleep mode, which will automatically lock the computer.

You can configure this as follows:

    System Preferences > Desktop & Screen Saver > Hot Corners.

    Specify the desired angle and select “Put monitor into sleep mode” in the drop-down menu.

    Click "OK".

Now, when you hold the mouse cursor in the selected corner, the computer will automatically turn off the display and lock itself.

Third party software



There are many third party programs and utilities that allow you to place the computer lock button on top panel on macOS. For example, Parallels Toolbox, where in the drop-down menu there is a quick computer lock option.

Let's say you forgot your Mac password. Or you just bought a Macintosh secondhand, and the previous owner locked the computer. There are several elegant solutions to this problem if you do not have a Mac OS X installation DVD. (We described the easiest way to reset your password using a disk earlier).

This topic may have gotten old, but it raises an important question that people ask all the time. I don’t want to think that any user who happens to be near your computer can theoretically gain access to it in a few minutes. And before you decide that Mac OS X has a serious vulnerability, I hasten to reassure you: any operating system, be it Windows, Linux or Mac, can be hacked in a couple of minutes if you know what to do. A hacker sitting at your computer can bypass any security measures.

The information presented below is taken from various sources on the Internet with the goal of helping people legally reset their Mac OS X password. We have collected various methods found by the Mac community on MacDigger for your convenience. I think the instructions will be useful for both ordinary users Macs and system administrators alike.

Resetting your password in Mac OS X 10.6 Snow Leopard

  1. Turn on or restart your Mac.
  2. During the greeting (or the gray screen if you turned off the annoying gong), hold down Command+S on your keyboard to boot into single-user mode.
  3. fsck-fy
  4. Write mount -uw / and press Enter.
  5. Next launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist and press Enter.
  6. Enter ls /Users and press Enter. The command will show a list of all users on the computer - useful if you don’t know or don’t remember.
  7. In line dscl. -passwd /Users/username password replace “username” with your username (see above), and instead of “password”, enter the code combination of characters and press Enter.
  8. reboot.

Resetting your password on Mac OS X 10.4 Tiger

  1. Turn on or restart your Mac.
  2. Write on the line sh /etc/rc and press Enter.
  3. Enter passwd username and replace “username” with the short username of the account for which you are going to reset the password.
  4. Enter your desired password and press Enter.
  5. To reboot, run the command reboot.

Trick Mac and create a new user.

  1. Turn on or restart your Mac.
  2. During the welcome screen (or the gray screen if you've turned it off), hold down Command+S on your keyboard to boot into single-user mode.
  3. The step is optional, but it is useful to go through it, because in this way you will check for errors on the hard drive. In the line enter fsck-fy and press Enter. Wait until the disk check is completed.
  4. Write mount -uw / and press Enter.
  5. Next rm /var/db/.AppleSetupDone and press Enter.
  6. Now shutdown -h now and press Enter.

The third method requires some clarification. Instead of replacing the password as in the first two methods, this is, in its own way, a deception of the operating system. The trick makes the system think that it has not been launched yet. This means that after you restart your Mac, you will have to go through all the settings and registration steps again. Don't worry, all the information on your Mac is safe and sound. Go through all the steps, but at the end, refuse to migrate your data to your Mac.

After that, log into your Mac with a new administrator account and go to Settings Panel -> Accounts. You may need to unlock the lock in the lower left corner before making changes. In the left column you should see the original account(s). Click on the desired account and turn it into a standard account (uncheck “Allow this user to administer the computer”) and change the password. Now you can log into your computer under this account and gain access to all your files and programs. You can log in again under the administrator account and check the “Allow” checkbox. This user should administer this computer” in System Preferences to give administrative rights to the user.

Now that's it. As always, remember that the combination of single-user mode (or superuser mode) and Terminal is extremely dangerous and can lead to big problems if you make mistakes.

If you have a password set in Keychain Access, you most likely need to reset it too. You can do this by selecting “input” under Keychain Access on the left and clicking Delete from the Edit menu. You will lose all Keys and add them again.

In case your Mac computer falls into the hands of third parties, Apple has a system that allows you to prevent criminals from using the device. However, sometimes, unfortunately, the owner himself may suffer from this, and in this case, locking a Mac turns into a severe headache.

It all started when one of our readers encountered an unpleasant problem: his iCloud password was remotely guessed and his computer was locked. It would seem that if he is the owner of the computer, Apple should be able to unlock the device without any problems. But everything turned out to be not so simple.

Procedure iPhone lock or iPad and Mac computer seriously different. In the second case, the EFI chip is blocked and needs to be reprogrammed, but this cannot be done remotely. We contacted Apple support and made sure that to unlock it you really need to contact the company's authorized service center.


But the most interesting thing is that the unlocking service turned out to be paid, since this is not a defect in the device, and the services charge money for it. Our reader from Murmansk was asked for 4,500 rubles for this. And this is in an authorized service center.

We interviewed representatives of several authorized service centers in Moscow and found out the average pricing policy for unlocking - from 1,500 to 2,000 rubles. Cheaper, what can I say. Also, when contacting the service center, you will need a receipt to confirm that you own the computer. They have special equipment for EFI reprogramming.

We can help you, for this you need documents about the purchase of the device, the cost of the work is 2,000 rubles, if attackers blocked the computer and deleted the data, then it is no longer available. The unlocking procedure consists of software resetting the enabled protection mode from motherboard Your device. No actions are taken with your disk.

As we managed to find out, the corresponding work is also carried out by unauthorized service centers. In this case, the EFI is unsoldered, the data is corrected using a programmer, and then the chip is installed back. This is not the simplest matter, so the price for the service is appropriate.

Third-party organizations also handle unlocking Macs - in this case, you need to pay them a certain amount (for example, $149), and then send them your computer for EFI flashing. Whether this is advisable is up to you to decide, but we would not recommend it. However, these guys will not ask for a purchase receipt or supporting documents.

There are other dubious organizations that accept payment and then send it to you by email special file, which supposedly unlocks the Mac. Here, as they say, at your own peril and risk, although there are video instructions.

So there are two ways out of the unpleasant situation with a locked computer - do everything in an authorized service center or trust third-party organizations. It’s strange that Apple charges money for this even if you have all the necessary documents. Moreover, even authorized service centers can set arbitrary prices - in this case, they are controlled only by the FAS, but not by Apple.

To avoid getting into this situation, under no circumstances register your Apple ID on mail.ru or yandex.ru. Accounts with exactly these postal services are most often hacked, according to Apple representatives.

Anything can happen in life, for example, you suddenly inherited a MacBook or iMac from your great-grandmother. Well, or another computer made by Apple. Everything is fine, you are glad of the happiness that has fallen, the euphoria is gradually replaced by the realization that the password for the computer is unknown, and, in general, there is no one to ask it from. What to do in this case - read on.

Of course, you will do everything described here at your own risk and there is nothing to complain about later. And of course, it is understood that such procedures will only be carried out if you actually do not know the password to your great-grandmother’s MacBook.

You can describe the process from the point of view of a command line guru, but this is inappropriate, since your great-grandmother’s MacBook is apparently your first MacBook, so it’s as simple and clear as possible about the main thing. How to get the most important and important password - the Administrator password!

To get started:

  • Command+S, copy-paste doesn't work here!
  • Wait until the lines of code run through, then carefully enter the command. This spell will do file system Readable and writable:
mount -uw /
  • Look for your great-grandmother's short system nickname:
ls /Users
  • Kill your great-grandmother's Keychain. Please note: instead of “nickname” you substitute the one you found with the previous command, this is important!
rm /Users/nickname/Library/Keychains/login.keychain
  • Restart your Mac:
reboot

As a result, the next time you boot, OS X will create a new Keychain, and great-grandmother will have nothing to do with it.

Now let's get down to the most important and interesting thing - we take control of the Mac into our own hands, resetting the most important and important Administrator password. There are a couple of options for how to do this, you can choose any one. And, if you’re not tired yet, let’s continue.

1. Use a bunch of commands:

  • Boot into Single-User mode: when loading, immediately hold down Command+S, copy-paste doesn't work here!
  • Wait until the lines of code run through, then carefully enter, the spell will make the file system readable and writable:
mount -uw /
  • Manually open the Open Directory - the thing that manages all the accounts on the computer (on Mac OS 10.6 and earlier this thing will not work - it’s simply not there):
launchctl load /System/Library/LaunchDaemons/com. .opendirectoryd.plist
  • Again, you are looking for the short system nickname of your great-grandmother, or the account whose password you need to reset. Remember:
ls /Users
  • Here you replace the “nickname” with the name obtained by the previous command:
dscl. -passwd /Users/nickname

If something like this suddenly pops up, don’t be alarmed, just ignore it:

Launchctl: Couldn’t stat (“/System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist”): No such file or directory nothing found to load

reboot

2. Use three times fewer commands:

OS X is very easy to cheat. For example, make the system think that they haven’t thought about installing it yet. To do this, you just need to delete one file, it says that the installation of OS X is complete, let him “think differently,” as Jobs bequeathed!

  • Again, boot into “Single-user mode”: when loading, immediately hold down Command+S, copy-paste doesn't work here!
  • Wait until the lines of code run through, then carefully enter the command, the spell will make the file system readable and writable:
mount -uw /
  • Delete the same file:
rm /var/db/.applesetupdone

Restart your Mac:

As a result, you get a brand new Mac that looks like it came straight from the store. Set up your account again, just like after installing the system. Moreover, the data of other accounts (and great-grandmother’s too) will remain untouched. Unless you enter a username that is already in the system.

3. Use “Recovery Mode”

  • Boot into “Recovery Mode”: when loading, immediately hold down Alt (Option), here we need a disk called “Recovery”
  • Through the “Utilities” menu, select the “Terminal” program
  • Enter the command, it will bring up a dialog box to reset the necessary and important Administrator password:
resetpassword
  • In the dialog box that appears, select boot disk, account, enter a new password with confirmation and select a question to recover it
  • Click “Save” and reboot using the corresponding “Apple” menu item. Great-grandmother would be proud of you!

In fact, it is not clear: impenetrable OS X and such “failures” in security! Such things can easily help attackers take over the contents of any Mac. Although, on the other hand, if it were not possible to access the Mac bypassing the Administrator account, then, say, having lost or forgotten the password, without installation disk You can say goodbye to all the information at your fingertips forever. But this is only if the great-grandmother did not enable FileVault disk encryption - none of the above methods will work then.

Operation