Skip to content

Instantly share code, notes, and snippets.

@ThinGuy
Created January 31, 2024 04:29
Show Gist options
  • Save ThinGuy/3216e5471025ffd8f1ebbcdbb7d501f2 to your computer and use it in GitHub Desktop.
Save ThinGuy/3216e5471025ffd8f1ebbcdbb7d501f2 to your computer and use it in GitHub Desktop.
Fix: BAD PASSWORD: The password contains the user name in some form.
# Work around for when you want/need your password to contain part of your username
# Disable the pwquality profile in PAM
sudo pam-auth-update --disable pwquality
# Change your password
echo 'ubuntu:Ubuntu123!'|sudo chpasswd -s
# Enable the pwquality profile in PAM
sudo pam-auth-update --enable pwqualit
@ThinGuy
Copy link
Author

ThinGuy commented Jan 31, 2024

$ debconf-get-selections 2>/dev/null|grep libpam-runtime/profiles
libpam-runtime  libpam-runtime/profiles multiselect     pwquality, unix, sss, systemd, gnome-keyring, capability

$ sudo pam-auth-update --force
$ debconf-get-selections 2>/dev/null|grep libpam-runtime/profiles
libpam-runtime  libpam-runtime/profiles multiselect     unix, sss, systemd, gnome-keyring, capability

$ echo 'ubuntu:Ubuntu1+'|sudo chpasswd -
$ sudo pam-auth-update --force

$ debconf-get-selections 2>/dev/null|grep libpam-runtime/profiles
libpam-runtime  libpam-runtime/profiles multiselect     pwquality, unix, sss, systemd, gnome-keyring, capability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment