3 ways to create and secure passwords in linux
In this guide, Three methods for setting passwords are explained; Using the passwd command Using openssl Using the crypt function in a C program passwd Passwords of users can be set with the passwd command. Users will have to provide their old password before twice entering the new one. As you can see, the passwd tool will do some basic verification to prevent users from using too simple passwords. The root user does not have to follow these rules (there will be a warning though). The root user also does not have to provide the old password before entering the new password twice. encryption with passwd Passwords are stored in an encrypted format. This encryption is done by the crypt function. The easiest (and recommended) way to add a user with a password to the system is to add the user with the useradd -m user command, and then set the user’s password with passwd. encryption with openssl Another way to create users with a password is to use the -p option of useradd, but that option requires an encrypted password. You can generate this encrypted password with the openssl passwd command. The openssl passwd command will generate several distinct hashes for the same password, for this it uses a salt. This salt can be chosen and is visible as the first two characters of the hash. encryption with...
Read More