I’m curious to know how the passwords in linux are maintained in /etc/shadow.
Even if you have two users with the same password, the associated entry in /etc/shadow is different.
u1 and u2 have both passwords set to 123
u1:$6$Ht/JdwSZ$no69zCL6q4KYapW2GKPy1iAHl3i.r.0WgvFF5KxF2pzYnG7WfG3.96no2lquIZBFmYJ0VX4VmJoTxErCGOE6c.:15508:0:99999:7:::
u2:$6$7LUQhoQa$V0S7rpjQ7QO1op0EbCpJ7j5B8iRWiKpbQob7axqREqb2q0z6Cs8NxJ1FzzTMNmAysq3ZWqmGjwDpwLZ1CigmB1:15508:0:99999:7:::
That is because of salt. The second part of an encrypted password field is salt, random sequence of characters that is appended to the password during hash calculation.
In your case the salts are
Ht/JdwSZand7LUQhoQa.