Passwd, Shadow & Opasswd

Linux can use different authentication mechanisms, most notably PAM. The most common modules are pam_unix.so or pam_unix2.so, located in /usr/lib/x86_x64-linux-gnu/security/. They manage user information, authentication, sessions, and current and previous passwords.
When changing a password with passwd, PAM is invoked and updates /etc/passwd, /etc/shadow, etc.

/etc/passwd

It contains information about each user on the system (readable by everyone). Each line describes a user with 7 fields separated by : — login name, password info, UID, GUID, full name, home directory, shell.

Removing the root Password

txt
# Antes
root:x:0:0:root:/root:/bin/bash
# Después
root::0:0:root:/root:/bin/bash
This would leave root without a password. This situation is uncommon, but administrators sometimes grant excessive permissions on /etc.

/etc/shadow

It stores password hashes. Format:
txt
usuario : $6$salt$hash : último_cambio : min_edad : max_edad : aviso : inactividad : expiración : campo_no_usado

/etc/security/opasswd

PAM can prevent old passwords from being reused by storing them here:
txt
cry0l1t3:1000:2:$1$HjFAfYTG$qNDkF0zJ3v8ylCOrKB0kt0,$1$kcUjWZJX$E9uMSmiQeRh4pAAgzuvkq1
Multiple hashes for the same user, separated by commas. Note whether they use MD5 ($1$) or another method.

Crack Hashes

terminal
# SHA-512 (shadow)$ hashcat -m 1800 -a 0 /tmp/unshadowed.hashes rockyou.txt -o /tmp/unshadowed.cracked# MD5 (opasswd)$ hashcat -m 500 -a 0 md5-hashes.list rockyou.txt