• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to enable md5 Hashing in Linux

by admin

Question: How to make sure that all passwords (root and non-root) are stored as MD5 Hashing standard?

NOTE: Here we are assuming that the default Hashing protocol is non MD5.

Please follow the below steps in order to achieve the same:

1. Run the below command:

# cat /etc/pam.d/system-auth | egrep "password|sufficient"

Output would be something similar to:

...

password    sufficient    pam_unix.so shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

...

2. Look for the line starts with “password sufficient“. Currently we do not see any Hashing protocol is mentioned. So we need to mention ‘md5’ here to make sure that is the Default Hashing used across all User’s.

Modify the line as below:

password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok

Save and come out of the file.

3. Now we have to change the password (of the existing Users) in order to activate MD5 Hashing. We can confirm it by running the command,

# cat /etc/shadow | grep test

Here test is a user name. We can expect something similar to:

test:$1$VwVZHnKm$9eiKyPyiJLSSfYd58RzbQ.:16692:0:99999:7:::

Here note the “$1$” which indicates that it is using MD5 Hashing.

Filed Under: Linux

Some more articles you might also be interested in …

  1. atop: command not found
  2. electrum: Ergonomic Bitcoin wallet and private key management
  3. ghci: The Glasgow Haskell Compiler’s interactive environment
  4. How to Compress and Decompress .bz2 files in Linux Using bzip2 Command
  5. diskonaut: Terminal disk space navigator, written in Rust
  6. ispell: command not found
  7. tc Command Examples in Linux
  8. How to make alias command work in bash script or bashrc file
  9. rm Command Examples in Linux
  10. lzop Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright