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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. amass db – Interact with an Amass database (Command Examples)
  2. “Failed to start test.mount: Unit is not loaded properly: Invalid argument.” – While mounting a fileystem using systemd
  3. Understanding the job control commands in Linux – bg, fg and CTRL+Z
  4. How to delete unused kernels and keep only the running kernel in CentOS/RHEL
  5. echo Command Examples in Linux
  6. wc: command not found
  7. ansiweather – A shell script for displaying the current weather conditions in your terminal
  8. CentOS / RHEL 7 : How to change the verbosity of debug logs during booting
  9. “su: Authentication failure” – in Docker
  10. gnome-screenshot Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright