Badari.hn wrote:
Forgot my MacBook password, I'm not able to login. It gives the option to reset with Apple ID. But every time I login, it shows "If you change the password for this user account, you will create a new Keychain to store the user's password" and restarts. This is repeating
The Mac login password allows access into the decryption key for the local keychain and into the local password store. This akin to the implementation on iPhone and iPad, where the passcode gives access to the decryption key. And on newer Mac systems with modern security, the login password is access to the decryption key for the user data, as well.
Few modern designs ever store the password or passcode itself, they either use the value directly as a decryption key or as decryption key allowing access into a “key bag” of passwords, or the system design stores the value as a cryptographic hash and disposes of the plaintext password. Future password comparisons are done by hashing the candidate password and comparing it with the saved hash. Cryptographic hashes are used, typically password hashes, and these hashes are intended to be one-way operations from plaintext to hash, and intentionally exceedingly difficult to reverse back from hash to a plaintext password.
The “key bag” design is used so that a very robust decryption key can be used for the user data, and while the user password quality can obviously vary, the robust key does not need to be changed and the entirety of the users data decrypted and re-encrypted every time the user changes their password. He only data that needs to be re-encrypted is the contents of the “key bag”.
If you reset the login password, you’ll want to regenerate the macOS login keychain:
If you need to update your keychain password on Mac - Apple Support
Other replies here including mine have linked to how to reset the login password.