I have some application that needs to create users that have the same password as others. Is there a way to do this without having to edit the /etc/shadow manually? Some sort of command?
On Linux, you can do this with the
Note that if anyone obtains the shadow file, they'll know immediately that the two users have the same password, because the two hashes will be using the same salt. There's no way to fix that without having to enter the actual password (which cannot be recovered from
Note that on most Linux installations, the command line of a running process is visible to all users. So if there are other users on the machine, they might be able to see the password hash (which gives them something they can try to brute-force offline). This can be fixed by using frameworks such as SELinux that hide process command lines from other users.