useradd -m -p "$(openssl passwd -1 $password)" "$username" is used to create a new user account with specific options
useradd: This command adds a new user to the system
-m: Creates the user's home directory if it doesn't exist
-p "$(openssl passwd -1 $password)": Sets the user's password securely. Here, openssl passwd -1 $password generates an encrypted password hash using OpenSSL's MD5 algorithm (-1 flag). This hash is then passed to -p for setting the user's password.
"$username": Specifies the username for the new user.
Real-life Example: Imagine a scenario where a DevOps engineer automates user account creation across multiple servers. They use this command in scripts to ensure that each new user has a secure password and a home directory, ensuring consistency and security across the infrastructure.
Sibasundar Sahoo you can check this