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

When you try to change user password on OpenBSD (opens in a new tab) and it is not strong enough, you will see the error:

console
$ 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 (opens in a new tab) enables you to get new encrypted password:

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

Then, vipw (opens in a new tab) follows to update the password file. Be very careful to edit it:

$ doas vipw

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

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

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

console
$ su <youruser>
Password:

More on: Configure and secure a server

OBSD Solutions

OBSD Solutions: OpenBSD consulting and support by Scqr, Reflerd Inc. (opens in a new tab)

Comments and feedback are welcome.