How do I disable dictionary checking for Linux passwords?

We do not recommend you disable dictionary checking or allow null (blank) passwords. The instructions below are provided for systems administrators who fully understand and accept the implications.

If you do not want passwords or permutations of them to be checked against a dictionary of words, you are not interested in checking passwords for their relative security quality or if they have been used before, and you are aware of the security implications of this, here’s how to disable the additional checks:

    • Make a backup copy of the file /etc/pam.d/system-auth:
cp /etc/pam.d/system-auth /etc/pam.d/system-auth.`date +%Y%m%d.%H%M%S`
    • Edit this file with a text editor:
vim /etc/pam.d/system-auth
  • Remove (or comment out) the line that references the module. On the following line, remove the use_authok option. For example, the new file might look like:
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      /lib/security/$ISA/
auth        sufficient    /lib/security/$ISA/ likeauth nullok
auth        required      /lib/security/$ISA/

account     required      /lib/security/$ISA/

password    sufficient    /lib/security/$ISA/ nullok md5 shadow
password    required      /lib/security/$ISA/

session     required      /lib/security/$ISA/
session     required      /lib/security/$ISA/


How do I reset my Linux server’s root password?

Reset Root Password

If a root password is forgotten, you can reset it:

  • Reboot the server
  • From the grub boot menu, select the kernel
  • Press the e key to edit the entry
  • Select second line (the line starting with the word kernel)
  • Press the e key to edit kernel entry so that you can append single user mode
  • Append the letter S (or word Single) to the end of the (kernel) line
  • Press ENTER key
  • Now press the b key to boot the Linux kernel into single user mode
  • You may need to mount at least / and other partitions:
mount -t proc proc /proc
mount -o remount,rw /
  • Change the root password, enter:

Finally reboot system:


How to I remove an OS user from Linux?

Warning: As always, please exercise caution when performing system maintenance, especially when initiating processes that can potentially delete data.

Locking a User Account

In most cases, there is no reason to remove an OS user. It is better to simply lock down the account to prevent any future login.

Remove User