Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Openssl passwd manually generates passwords

Shulou Source: shulou.com Published: 2022-06-01 01:46:46 10月04日 Update

Introduction: in the Linux system, we want to generate a password manually. We can use opensll passwd to generate a password as the password for the user's account. The passwords in the Linux system are stored in the / etc/shadow file and are stored in an encrypted way. According to the different encryption methods, the number of digits of the encrypted passwords generated is also different.

The function of openssl passwd is to calculate the password hash in order to prevent the password from appearing in clear text.

Syntax format: openssl passwd [option] passwd

The common options for openssl passwd are as follows:

-1: indicates that MD5 encryption algorithm is used.

-salt: specify a salt value and do not use randomly generated salt. When using the encryption algorithm to encrypt, even if the password is the same, the salt is different, the calculated hash value is not the same, unless the password is the same, the salt value is the same, the calculated hash value is the same. The salt is an 8-byte string.

Example:

[tom@localhost] $openssl passwd-1-salt '12345678' # # Note '12345678' is not the password but the length of the password

Password: # # the password is entered here

$1 $12345678 $1qWiC4czIc07B4J8bPjfC0 # # this is the generated ciphertext password

# # manually add the generated password string to / etc/shadow and it can be used as the login password of the user.

Tags: Passwords encryption generation manual different methods users algorithms systems digits functions characters strings bytes ciphertext commonly used introductions forms files plaintext Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB NVidia Shulou Tech Info Shulou Information