June 17, 2022

RHEL 9.0 How to Disable BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word

NEVER USE THIS IN A NOT TEST/DEVELOPMENT ENVIRONMENT

$ sudo passwd student
Changing password for user student.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word

You need to change 2 lines.

$ sudo vim /etc/pam.d/system-auth
...
# password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password    sufficient    pam_unix.so try_first_pass nullok sha512 shadow

Here is the diff

$ sudo diff /etc/pam.d/system-auth /etc/pam.d/system-auth.ORIG 
10,11c10,11
< # password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
< password    sufficient    pam_unix.so try_first_pass nullok sha512 shadow
---
> password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
> password    sufficient    pam_unix.so try_first_pass use_authtok nullok sha512 shadow

Now you can set weak password for users.

RHEL 9.0 How to Change the Tab Size in VIM

$ sudo dnf install vim-enhanced bash-completion -y
$ sudo vim /etc/vimrc
...
set tabstop=2
set shiftwidth=2
set expandtab

Set default editor to vim.

$ sudo vim /etc/profile
...
EDITOR=vim

After installing bash completion you need to login out and then login before completion takes affect.

https://stackoverflow.com/questions/2054627/how-do-i-change-tab-size-in-vim