How to change user password to the weak forcedly on OpenBSD 7.1 (not recommended)

@nabbisen

When you try to change user password on OpenBSD and it is not strong enough, you will see the error:

$ passwd
Changing password for <youruser>.
Old password:
New password:
Please use a more complicated password.
Please use a different password. Unusual capitalization,
control characters, or digits are suggested.
New password:

You had better follow the messages.

Please use a more complicated password. Please use a different password. Unusual capitalization, control characters, or digits are suggested.

However, some might be sometimes unable to do it.

In such a case, what to do is to encrypt new password manually and then apply it as admin also manually. Here is the way.

First, encrypt enables you to get new encrypted password:

$ encrypt
# enter your password
# and encrypted chars will be printed

Then, vipw follows to update the password file. Be very careful to edit it:

$ doas vipw

Here, search the line on <youruser> and rewrite it:

  (...)
- <youruser>:currentencryptedpassword:(...)
+ <youruser>:newencryptedpassword:(...)
  (...)

That’s it. Check if you can log in with new password:

$ su <youruser>
Password:

Comments or feedbacks are welcome and appreciated.