{"id":40475,"date":"2023-08-29T11:58:57","date_gmt":"2023-08-29T15:58:57","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=40475"},"modified":"2024-02-28T16:21:57","modified_gmt":"2024-02-28T21:21:57","slug":"mac-wont-accept-correct-login-password","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/08\/29\/mac-wont-accept-correct-login-password\/","title":{"rendered":"Mac Won&rsquo;t Accept Correct Login Password"},"content":{"rendered":"<p>I was recently surprised to find that my Mac kept rejecting my password at boot. I&rsquo;ve been using the same password for years and was sure it was correct. I typed it slowly while looking at the keys. I made sure that the Caps Lock key was not down. I also tried the MacBook Pro&rsquo;s built-in keyboard, in case I&rsquo;d worn through another <a href=\"http:\/\/www.atpm.com\/14.05\/apple-keyboard.shtml\">USB Apple aluminum keyboard<\/a>. macOS kept not recognizing the password and locking me out of retrying for increasing amounts of time.<\/p>\n<p>I rebooted into <a href=\"https:\/\/support.apple.com\/guide\/mac-help\/intro-to-macos-recovery-mchl46d531d6\/mac\">macOS Recovery<\/a>, which <em>did<\/em> accept my password and let me unlock the drive in Disk Utility. My data was safe.<\/p>\n<p>I did some searching online. Most pages are about resetting your password if you&rsquo;ve <a href=\"https:\/\/support.apple.com\/en-us\/102633\">forgotten it<\/a>. Some <a href=\"https:\/\/discussions.apple.com\/thread\/5943381\">other<\/a> <a href=\"https:\/\/discussions.apple.com\/thread\/8429791\">users<\/a> <a href=\"https:\/\/discussions.apple.com\/thread\/253795677\">seemed<\/a> <a href=\"https:\/\/forums.macrumors.com\/threads\/cant-login-even-the-password-is-correct-please-help.2301916\/\">to<\/a> be in the same situation as me but didn&rsquo;t have a solution. There were suggestions to <a href=\"https:\/\/support.apple.com\/en-us\/HT204063\">reset the NVRAM<\/a> (didn&rsquo;t help) and to <a href=\"https:\/\/support.apple.com\/en-us\/HT201295\">reset the SMC<\/a> (seems to happen automatically on Apple Silicon, anyway).<\/p>\n<p>Eventually I figured it out: I had been typing the correct keys, but they had been producing the wrong characters because the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dvorak_keyboard_layout\">Dvorak keyboard layout<\/a> was selected. Earlier in the day, I had been writing some code for <a href=\"https:\/\/c-command.com\/spamsieve\/\">SpamSieve<\/a> so that its hotkeys would work with different keyboard layouts, even though the virtual keycodes in <tt>Events.h<\/tt> such as <code>kVK_ANSI_S<\/code> refer to the ANSI-standard US keyboard. To test this, I had been switching among different keyboards. Even though I had long since switched back to the QWERTY layout, the login screen had remembered a previous setting. In fact, even after I selected the proper keyboard from the menu on the login screen, it still switched back to Dvorak on the next reboot. I had to delete Dvorak in System Settings to prevent this from happening.<\/p>\n\n<p id=\"mac-wont-accept-correct-login-password-update-2023-08-30\">Update (2023-08-30): <a href=\"https:\/\/eclecticlight.co\/2022\/11\/30\/an-a-to-z-of-keys-and-keyboards-startup-and-login\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2022\/11\/30\/an-a-to-z-of-keys-and-keyboards-startup-and-login\/\"><p>During normal startup, before you have logged in as a user, your Mac doesn&rsquo;t use the custom keyboard set for a specific user, and in older versions of macOS should use that stored in \/Library\/Preferences\/com.apple.HIToolbox.plist, which may be quite different from any set in a user&rsquo;s ~\/Library\/Preferences\/com.apple.HIToolbox.plist file. This doesn&rsquo;t appear to be true for Ventura, where the pre-login settings are now hidden.<\/p><p>In some cases, this can prevent passwords from being entered correctly, and can readily confuse. When there&rsquo;s only a single admin user, macOS should keep settings in sync, but when there are multiple users with different keyboard settings, they can become confused.<\/p><p>[&#8230;]<\/p><p>Like all preference files, they are now maintained by a service which means that editing them directly is unlikely to do a great deal: the service will happily overwrite the files with what it thinks they should be.<\/p><\/blockquote>\n<p>That is apparently what happened to me. The service saved the wrong keyboard, i.e. not what I had selected in System Settings, even though there was only one admin user. And then it failed several times to update the login setting.<\/p>\n\n<p><a href=\"https:\/\/mastodon.social\/@boxyrobot\/110977004806461814\">Jevgeni Mullo<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@boxyrobot\/110977004806461814\">\n<p> Hey, it wasn&rsquo;t just for me! The difficulty that I had was macOS showing correct layout being selected, yet actually using a different one. And then, quietly not switching the layout when I actively selected desired one in the language drop-down. I was going nuts.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/mjtsai.com\/blog\/2023\/08\/29\/mac-wont-accept-correct-login-password\/#comment-3959210\">Carlos August<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mjtsai.com\/blog\/2023\/08\/29\/mac-wont-accept-correct-login-password\/#comment-3959210\"><p>I use both an English and Spanish layout in my MBP. Although English is the default (and the language I need to be in to type my password due to muscle memory), my MBP has been choosing the Spanish layout on first boot for <em>years<\/em>.<\/p><p>I have been trying to fix since day 1, no luck.<\/p><\/blockquote>\n\n<p id=\"mac-wont-accept-correct-login-password-update-2023-09-05\">Update (2023-09-05): <a href=\"https:\/\/eclecticlight.co\/2021\/01\/21\/system-management-and-nvram-on-m1-macs\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2021\/01\/21\/system-management-and-nvram-on-m1-macs\/\">\n<p>This stores key settings which the M1 Mac can&rsquo;t obtain from internal disk storage during the early part of the boot process. An example is the location of the boot volume to be used. In Intel Macs, these are stored in discrete memory which can be reset to factory defaults. M1 Macs are different again, in that there&rsquo;s no single manoeuvre which resets the contents of NVRAM.<\/p>\n<p>[&#8230;]<\/p>\n<p>NVRAM contents are listed in <strong>System Information<\/strong> under <strong>Software<\/strong> &gt; <strong>Logs<\/strong> &gt; <strong>NVRAM contents<\/strong>, and can be edited using the <code>nvram<\/code> command in Terminal. Many of the variables contained in the NVRAM of an M1 Mac aren&rsquo;t intended to mean anything to the user, nor should they be changed or removed. Among those of interest and potential use are the following:<\/p>\n<p>[&#8230;]<\/p>\n<p><code>prev-lang:kbd<\/code> &#x2013; the initial keyboard language, such as <code>en-GB:2<\/code> for British external (supplied as a string).<\/p>\n<\/blockquote>\n\n<p id=\"mac-wont-accept-correct-login-password-update-2024-02-28\">Update (2024-02-28): <a href=\"https:\/\/eclecticlight.co\/2024\/02\/28\/solving-login-password-problems\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2024\/02\/28\/solving-login-password-problems\/\">\n<p>If you can&rsquo;t seem to enter the right password, be very careful: don&rsquo;t just keep trying in the hope that you&rsquo;ll get it right, as you could end up locking up your Mac altogether.<\/p>\n<p>[&#8230;]<\/p>\n<p>If that doesn&rsquo;t do the trick, open the keyboard menu item at the top right, and check that you&rsquo;re using the correct keyboard layout for the language you&rsquo;re using. Although it&rsquo;s not common, sometimes this menu changes its mind, and there&rsquo;s nothing worse than trying to enter a password based on an English QWERTYUIOP keyboard layout when your Mac is expecting it from a French AZERTY layout.<\/p>\n<p>[&#8230;]<\/p>\n<p>This may give you the option of resetting your password using your Apple ID, in which case click the arrow next to that and provide your Apple ID and its password, then follow the instructions. The alternative is to use your Recovery Key if you&rsquo;ve already obtained one, which is again selected by clicking on the arrow, after which you enter the key and follow the instructions.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/10\/17\/not-setting-up-find-my-bricked-my-macbook\/\">Not Setting Up Find My Bricked My MacBook<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>I was recently surprised to find that my Mac kept rejecting my password at boot. I&rsquo;ve been using the same password for years and was sure it was correct. I typed it slowly while looking at the keys. I made sure that the Caps Lock key was not down. I also tried the MacBook Pro&rsquo;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-08-29T15:58:59Z","apple_news_api_id":"d1f19e09-9e1f-46bc-85da-5a9c8d03db0e","apple_news_api_modified_at":"2024-02-28T21:22:01Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAw==","apple_news_api_share_url":"https:\/\/apple.news\/A0fGeCZ4fRryF2lqcjQPbDg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[131,706,423,30,2223,2088,981],"class_list":["post-40475","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-filevault","tag-keyboard","tag-mac","tag-macos-13-ventura","tag-macos-recovery","tag-passwords"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=40475"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40475\/revisions"}],"predecessor-version":[{"id":42265,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40475\/revisions\/42265"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=40475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=40475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=40475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}