Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cristiarg/fb8bbd1a70e089991e8f83461c053f01 to your computer and use it in GitHub Desktop.
Save cristiarg/fb8bbd1a70e089991e8f83461c053f01 to your computer and use it in GitHub Desktop.
==================================
- works in Ubuntu 22.
- to allow trivial password (basically, bypass all complexity verifications):
- as root, run `pam-auth-update --force`, in the dialog, disable "Pwquality password strength checking"
- what this actually does is to edit the `/etc/pam.d/common-password` file
- so you can compare the contents of this file before and after to see what modifications have actually been made
- in my case:
- before:
```
password requisite pam_pwquality.so retry=3
password [success=2 default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt
```
- after:
```
password [success=2 default=ignore] pam_unix.so obscure yescrypt
```
- be sure to restore the setting "Pwquality password strength checking" afterwards with `pam-auth-update --force`
- what I tried from the various SO and blogs to manually edit the config file turned out not to work reliably
==================================
- Ubuntu 18
as seen on:
https://askubuntu.com/questions/180402/how-to-set-a-short-password-on-ubuntu/180435#180435
this works without any additional packages
Bring up a terminal and edit /etc/pam.d/common-password
Change this line:
```
password [success=1 default=ignore] pam_unix.so obscure sha512
```
to:
```
password [success=1 default=ignore] pam_unix.so obscure sha512 minlen=4
```
Password also need a certain amount of complexity, as specified by the obscure parameter above.
```
password [success=1 default=ignore] pam_unix.so minlen=2 sha512
```
removes that check also.
This all presupposes that you think this is wise.
See `man pam_unix`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment